Question

I have a working rewrite rule in my .htaccess file, it's supposed to redirect from pages ending with /, to without them.

So for example http://mysite.com/gallery/ will redirect to http://mysite.com/gallery

The rewrite rule looks as follows:

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} ^(.+)/$
RewriteRule ^(.+)/$  /$1 [R=301,L]

and works 99%. The only problem I'm having is that I need to exclude this for

http://mysite.com/admin.php/whatever_may_follow

I'm not a pro on these rules, and was hoping if someone could give a pointer as to how I can exclude admin.php from the rule.

Thanks in advance! ;)

Was it helpful?

Solution

RewriteCond %{REQUEST_FILENAME} !admin.php$
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top