Use .htaccess
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
The code above will get rid of the .php
extension, thus giving you say index
instead of index.php
. And yes it works on localhost
and nearly all hosting companies include it.