Create htaccess rule with parentheses in url

I am trying to create a redirect rule for the following url

https://www.mywebsite.com/catalogsearch/advanced/result/?category=39&price%5bfrom%5d=8000&price%5bto%5d=10000

      

And I use the following rule

    RewriteCond %{QUERY_STRING} ^category=39&price\[from\]=8000&price\[to\]=10000
RewriteRule ^catalogsearch/advanced/result/ https://www.mywebsite.com/my-new-page [L,R=301]

      

I checked the rule on this website http://htaccess.madewithlove.be/

and his work on the tester. But the rule doesn't work on my site. What is wrong with my rule and what should I do to fix it?

Thanks in advance.

+3


source to share


1 answer


Try:

RewriteCond %{QUERY_STRING} ^category=39&price\x5bfrom\x5d=8000&price\x5bto\x5d=10000
RewriteRule ^catalogsearch/advanced/result/ https://www.mywebsite.com/my-new-page [L,R=301]

      



or with:

RewriteCond %{QUERY_STRING} ^category=39&price\x255bfrom\x255d=8000&price\x255bto\x255d=10000

      

+1


source







All Articles