Hi, Some time ago I requested help with a rewrite rule to strip trailing slash(es) from all URLs in our joomla website, but I'm still having problems. This is the rule I am currently working with: RewriteRule ^(.*)/+$ https://linuxsecurity.com$1 [R=301,L] It works fine for any URL other than the homepage. Somehow for
the homepage it creates an infinite loop, despite using "L", so
perhaps I don't understand what it's doing. The (.*) is supposed
to match any character, but there wouldn't be any preceding
elements for the homepage. The problem as I see it is that, for the homepage, (.*) would be null, so $1 would also be null? This then creates the same URL as the one we're trying to fix. First it appears to work properly (trimmed for legibility): init rewrite engine with requested uri / then it looks like it inits the rewrite engine again? init rewrite engine with requested uri /, referer:
https://linuxsecurity.com/ This just loops repeatedly until it dies. I've also made sure
there's only one "RewriteEngine on" in the virtual host config and
the .htaccess. Would that even matter? What am I doing wrong? I've tried a thousand variations of this to no avail.
|