Answer the question
In order to leave comments, you need to log in
How to make a redirect from all GET requests for the main page to itself without parameters?
Good day, colleagues! Help me solve a problem that I couldn’t solve with my narrow brain ...
You need to make a 301 redirect to www (both with www and without www) on the main page,
if after the slash http://(www.)site.ru/ there is a sign ?
Those. it is necessary if a request with a GET parameter goes to the main one - it’s easy to redirect to the main one
Answer the question
In order to leave comments, you need to log in
I answer my own question:
RewriteCond %{THE_REQUEST} " /\?"
RewriteRule ^ /? [R=301,L]
RewriteCond %{THE_REQUEST} " /\?"
RewriteRule ^ http://www.site.ru/? [R=301,L]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question