I am trying to implement URL rewriting in my PHP application. Can someone share a step by step procedure of implementing URL rewriting in PHP and MySQL?
In my applic
Unfortunately, it's really up to the web server, not PHP. Depending on if you use Apache or something else, it has to do this before your script is executed. I use mod_rewrite, and an example rewrite rule looks like this:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/%{REQUEST_URI} [PT,L]
The above rule basically says if the URL is a valid path to a real file or directory, load it. Otherwise, run it through index.php.