maanantai 13. huhtikuuta 2015

Remove .php extension

To remove .php extension from your site url, for example testsite.com/blog.php to just testsite.com/blog you need to do the following in your system:

$sudo a2enmod rewrite which allows apache to rewrite names. Then create hidden .htaccess file in your website root folder and type:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
Edit your navigation page and remove all extensions. Like this: 


You also need to edit your virtualhost files which allows this. 



Ei kommentteja:

Lähetä kommentti