Answer the question
In order to leave comments, you need to log in
Why are htaccess rules not working?
I ask for help. I write rules in .htaccess, and for example, such a 301 redirect works
RewriteCond %{QUERY_STRING} ^post_type= [NC]
RewriteRule (.*) $1? [R=301,L]
RewriteCond %{QUERY_STRING} ^type=rss$
RewriteRule (.*) $1? [R=301,L]
Для этого https://site.com/blog/retsepty-s-medom.feed?type=rss
RewriteCond %{QUERY_STRING} ^post_type= [NC]
RewriteRule (.*) $1? [R=301,L]
и для этого https://site.com/add.html?category_id=1&product_id=2
Answer the question
In order to leave comments, you need to log in
For those who are interested, I solved the problem in this way
Options +SymLinksIfOwnerMatch
RewriteEngine on
Redirect 301 /blog/retsepty-s-medom.feed https://site.com/
RewriteCond %{QUERY_STRING} ^category_id= [NC]
RewriteRule (.*) $1? [R=301,L]
Do you have Apache or pure nginx? If the second, then htaccess will be ignored and the whole rule must be written in the config.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question