Hello, I am experiencing an infinite loop when a slash is placed in the url before the query string.
This works perfectly fine: www.site.com/reviews?something=else
This however, goes into an infinite loop: www.site.com/reviews/?something=else
I cant figure out why its doing it in the first place, or how to correct it.
I tried removing the slash on that specific url if there isn't one:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} ^/reviews/$
RewriteRule (.*)$ [
site.com...] [R=301,QSA,L]
And that seems to take out the slash only if there is no query string. So www.site.com/reviews/ would rewrite to www.site.com/reviews. But if there are any variables in the URL, it leaves the / in there.
Any ideas?
Thanks!
Update:
Doing this
RewriteCond %{REQUEST_URI} ^/reviews/$
RewriteCond %{QUERY_STRING} !=""
RewriteRule (.*)$ [
site.com...] [R=301,QSA,L]
Seems to have removed the / when there is a query. Not sure if that is 100% correct though.