Removing Extensions .html .php

Removing Extensions

To remove the .php extension from a PHP file for example to you have to add the following code inside the .htaccess file:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]

If you want to remove the .html extension from a html file for example to you simply have to alter the last line from the code above to match the filename:

RewriteRule ^([^\.]+)$ $1.html [NC,L]

Have your say