I have a folder containting my files with the extension .php i would like it to look like this in the url /filename/ which points to filename.php
The below sort of works but when the file does not exist it gets into an infinite loop??
- Code: Select all
#match everything until the slash and then point to same name .php
#make sure its not a directory
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ $1.php [L]
I would also like rewrite the url if people try to access filename.php back to /filename/.
Thanks for the help.
PS, i am using .htaccess