Answer the question
In order to leave comments, you need to log in
How to replace part of the address?
Hey!
How to replace part of url with 301?
site.ru?param1=text1¶m2=text2
to
site.ru?param2=text2
Moreover, the param1 part to be replaced can be both at the end and at the beginning of the get request, and it can also be different text1
I try unsuccessfully to do so. Works only on the main page of the site, does not work on internal pages
RewriteCond %{QUERY_STRING} ^(.*)param1=text1+(.*)$ [NC]
RewriteRule ^(.*)$ /$1?%1%2 [R=301,L]
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