Removing Extensions .html .php
Removing Extensions
To remove the .php
extension from a PHP file for example odnuly.cz/servis.php
to odnuly.cz/servis
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 odnuly.cz/servis.html
to odnuly.cz/servis
you simply have to alter the last line from the code above to match the filename:
RewriteRule ^([^\.]+)$ $1.html [NC,L]