Answer the question
In order to leave comments, you need to log in
How to make rdirect in htaccess with character replacement in parameter?
There is a URL like:
/index.php?route=extension/payment/test/check&trx_id=321&lang_code=ru&merch_id=123&o.order_id=18&ts=20200413+10%3A38%3A31 You
need to check that route=extension/payment/test/check and do 301 redirect with the + symbol replaced by a T in the ts parameter.
The difficulty is that the set of parameters is not constant (they can be presented or not), and the replacement is needed only in ts.
Answer the question
In order to leave comments, you need to log in
GET - is not part of the url, and because of this RewriteRule it does not hit at all, from the word at all.
Therefore, it is distinguished through RewriteCond
# 301 --- http://www.test.com/faq.html?faq=13&layout=bob => http://www.test2.com/faqs.html
RewriteCond %{HTTP_HOST} ^www\.test\.com$
RewriteCond %{QUERY_STRING} (^|&)faq\=13($|&)
RewriteCond %{QUERY_STRING} (^|&)layout\=bob($|&)
RewriteRule ^faq\.html$ http://www.test2.com/faqs.html? [L,R=301]
...faqs.html?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question