Forum Moderators: phranque
This is my situation.
My URLs currently look like this:
[domain.com...]
I have managed to get rid of the PHP extensions with .htaccess and the following instructions:
# remove .php; use THE_REQUEST to prevent infinite loops
RewriteCond %{THE_REQUEST} ^GET\ (.*)\.php\ HTTP
RewriteRule (.*)\.php$ $1 [R=301]
Now I need help adding a slash to the end so that my URLs will look like:
[domain.com...]
Please help. I have been Googling like mad!
# remove .php; use THE_REQUEST to prevent infinite loops
# due to DirectoryIndex redirects to .php files
RewriteCond %{THE_REQUEST} ^GET\ /[^.]+\.php\ HTTP
RewriteRule ^([^.]+)\.php$ [b]$1/[/b] [R=301]
Jim
I go to my site say [domainname.com...]
I click on a link. The actual link to the file is say [domainname.com...]
With your commands in .htaccess the browser attempts to go to [domainname.com...]
However the browser either 403s or it removes the slash and I get what I had before: [domainname.com...]
Or it interprets [domainname.com...] to be a folder, and if there is a folder link/ then it shows me the directory contents or index.