To do such a URL, you can use a project pattern called Front Controller, where all requests from your site will be managed by index php.
Example of what Urls look like with front-controller:
seusite.com/categorias
seusite.com/categoria/1
seusite.com/categoria/create
Understanding the concept and applying it to your project would look like this. When a request hits your index.php (example: seusite.com/Nomedoperfil ) your index will search your database for that username. If it exists it brings the view with user information.
It is quite simple to set up a Front Controller in a pure PHP project, but an alternative is to work with a PHP framework that already has in its core this project standard and many others that facilitate the development of applications, always following the best practices. I’ll leave a few links in case you’re interested.
Hugs !
Possible duplicate of How can I simplify Urls for a website?
– NoobSaibot
The easiest way and the one I use is a
RewriteRule
with . htaccess.– Thomas Franklin