Answer the question
In order to leave comments, you need to log in
How to make a correct redirect?
Hello.
There was a need to remove duplicate pages in categories and subcategories of the site as follows:
RewriteCond %{QUERY_STRING} ^(.*)&?page=1$
RewriteRule ^(.*)/?$ /$1?%1%2 [R=301, L]
But another problem appeared: if you use the site search, then when you go from any page displayed in the search results to the first one, the search query is encoded, for example:
https://example.ru/search?query=%25D1%2581 %25D1%25...
It's a redirect, but how can I change it to fix the problem?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question