lundi 30 mars 2015

Automatically go to subdirectory index page .htaccess rule

I want that when I click on a link like this: <a href="settings/">Settings</a> it will go to the subdirectory, and load index.php. When I try this right now I get a 404 error


It works if the link is as so: <a href="settings/index.php">Settings</a> but I don't want index.php in the url.


Does anybody know how can I write an .htaccess rule to achieve this ?


.htaccess



DirectoryIndex index.php index.html

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




Aucun commentaire:

Enregistrer un commentaire