Answer the question
In order to leave comments, you need to log in
How to make a Redirect 301 if there is one in the URL?
How can I redirect through htaccess for several addresses, for example:
www.mysite.ru/category1/?page=1 to www.mysite.ru/category1/
www.mysite.ru/category2/?page=1 to www.mysite. ru/category2/
www.mysite.ru/any-category/?page=1 to www.mysite.ru/any-category/
etc.
Tried like this:
RewriteRule ^category1/?page=1$ www.mysite.ru/category1/ [R=301,L]
RewriteRule ^category2/?page=1$ www.mysite.ru/category2/ [R=301,L]
RewriteRule ^any-category/?page=1$ www.mysite.ru/any-category/ [R=301,L]
Answer the question
In order to leave comments, you need to log in
# 301 --- www.mysite.ru/any-category/?page=1 => www.mysite.ru/any-category/
RewriteCond %{QUERY_STRING} (^|&)page=1($|&)
RewriteRule ^www\.mysite\.ru/any-category/$ /www.mysite.ru/any-category/? [L,R=301]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question