I posted up a question about an hour ago asking a regex question about trailing slashes
And a very helpful person gave me this to redirect pages with a trailing slash to a page with none.
However I have just noticed that it causes an infinite (never ending loop) of redirects if you try and access a folder, as you go to say http://example.com/images the server (Apache) adds a trailing slash as its a directory, then the Regex removes the slash, redirects back to the http://example.com/images URL which then gets its slash added back on by Apache etc etc :/
Any Ideas as to how to modify the rule below to prevent this?
RewriteRule ^(.*)/$ $1 [R=301]
Many thanks, help always appreciated! 🙂
Added in the line below just above my current RewriteRule ^(.*)/$ $1 [R=301] rule
Thanks for the reply though limc 🙂