Answer the question
In order to leave comments, you need to log in
HTACCESS redirect with saving/copying parameters on opencart 1.5?
Friends, how to make a redirect to OPENCART 1.5 from one address to another with full copying of arguments. The request comes from 1 address, but the parameters are different each time, and it is these parameters that must be automatically transferred each time to a new address.
old-link.ru/page?utm=utm1
old-link.ru/page?utm=utm2
old-link.ru/page?utm=utm3
new-link.ru?utm=currentUtm
_
RewriteCond %{QUERY_STRING} ^_route_=page.*
RewriteRule ^(.*)$ new-link.ru? [R=301,L,QSA]
It turns out: new-link.ru?&^_route_page&utm=utm1
And it is necessary: new-link.ru?utm=utm1
He substituted my label, but opencart cannot get rid of the ROUTER label.
Can you please tell me if it works or what I did wrong? Thank you!
Answer the question
In order to leave comments, you need to log in
%{QUERY_STRING} - is not part of the url and stands out in a separate way
RewriteCond %{QUERY_STRING} (^|&)utm=(.+)($|&)
RewriteRule ^page\.php$ /new-link.ru\?utm=%2 [L,R=301]
RewriteRule ^page$ http://new-link.ru/page [R=301,L]
RewriteRule ^([^?]*) index.php?_route_=$1
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question