The easiest way to follow in your case is to use url rewriting in the . htaccess file.
What is a. htaccess file?
The files. htaccess files are Apache access and configuration files, they are files read by Apache every time you try to access a file that is inside a folder (or sub folders) where there is a file .htaccess. In this file we can create access lock rules, URL redirects and rewrites.
Example
# redirect "/section.php?id=xxx" to "/section/xxx"
RewriteCond %{THE_REQUEST} \s/section\.php\?id=([0-9]+)\s [NC]
RewriteRule ^ /section/%1? [R=301,L]
# internally rewrite "/section/xxx" to "/section.php?id=xxx"
RewriteRule ^section/([0-9]+)$ /section.php?id=$1 [L]
To get deeper into the subject follow this step by step, it is very simple to implement! http://blog.thiagobelem.net/aprendendo-urls-amigaveis
You want to know "what’s the best way to do that" or "how to do this"?
– Victor Stafusa