Just detailing what Anderson said, you can use URL rewriting.
-
The .htaccess (the name of the file is written in this way, with a dot in front) is a special file used by Apache (web server) that checks if there is any restriction or special configuration for the directory accessed. It is with it that we will enable URL rewriting and configure other necessary parameters.
Create the .htaccess file, insert the content below and save it to the root folder of your project (the same as your index.php).
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
The first line enables rewriting.
The second and third lines tell Apache to ignore the rewrite if the address refers to a file ("f" file) or directory ("d").
The fourth line tells Apache which rewrite rule will be applied. It basically captures everything that comes after index.php and returns as parameter to the page. I will not go into much detail in this configuration, but in case you want to know more about it, I suggest you see the apache mod_rewrite documentation.
There are some variations of this configuration, but this is the one I use.
NOTE: Also remember to enable Apache mod_rewrite and restart it. If you do not know how to search on Google according to your operating system.
-
Take a look at this blog:
link