There is a page http://new.mydomain.ru/catalog/category/?set_filter=y&arbFilter_230_1525441506=Y . It is necessary to put a redirect from it to the page http://mydomain.ru/catalog/category/subcategory .

In .htaccess ' I write:

 RewriteEngine on RewriteCond %{QUERY_STRING} ^set_filter=y&arbFilter_230_1525441506=Y$ RewriteRule ^catalog/category/$ http://mydomain.ru/catalog/category/subcategory [R=301,L] 

But the proper effect is not observed. What am I doing wrong?

  • It seems all the rules. The only thing is if you do not need arguments ( ?set_filter=y&arbFilter_230_1525441506=Y ), then put a question mark at the end: RewriteRule ^catalog/category/$ http://mydomain.ru/catalog/category/subcategory? [R=301,L] RewriteRule ^catalog/category/$ http://mydomain.ru/catalog/category/subcategory? [R=301,L] Ie the output is http://mydomain.ru/catalog/category/subcategory with no arguments. Check here . - romeo
  • With the sign "?" also incomprehensible going on. That is, the parameters from the URL are not removed during the redirect. And it turns out the following: http://mydomain.ru/catalog/category/?set_filter=y&arbFilter_230_1525441506=Y - pkrymskaya
  • Perhaps the problem is in case-sensitive arguments. You have uppercase and lowercase letters alternate. You can use the flag [NC] . Those. RewriteCond %{QUERY_STRING} ^set_filter=y&arbFilter_230_1525441506=Y$ [NC] - romeo
  • pkrymskaya, comments are limited in formatting. Use this to edit your question. - romeo
  • @romeo Please make your comment a response. - Nicolas Chabanovsky

1 answer 1

Probably you in .htaccess ' e above this rule is still a redirect to the category itself.

Those. sort of:

 RewriteRule ^catalog/category/$ http://mydomain.ru/catalog/category/ [R=301,L] 
  • Yes, it was. Thank! - pkrymskaya