A
A
ArtemMRVZ2021-04-22 12:23:35
htaccess
ArtemMRVZ, 2021-04-22 12:23:35

How to correctly configure 301 redirect Opencart with GET parameters?

Faced the problem of setting up a redirect in opencart, namely, I set up the CNC for the page and there was a need for a 301 redirect

https://site.ru/index.php?route=product/product&path=123&product_id=123 - старый URL
https://site.ru/catalog/new_page - новый URL


Tried like this:

RewriteCond %{QUERY_STRING} ^_route_=product/product&path=123&product_id=123$
RewriteRule ^(.*)$ https://site.ru/catalog/new_page? [R=301,L]


But the redirect doesn't work. Tell me what might be wrong.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Taran, 2021-04-22
@ArtemMRVZ

RewriteCond %{QUERY_STRING} (?:^|&)route\=product/product(?:$|&)
RewriteCond %{QUERY_STRING} (?:^|&)path\=123(?:$|&)
RewriteCond %{QUERY_STRING} (?:^|&)product_id\=123(?:$|&)
RewriteRule ^index\.php$ /catalog/new_page? [L,R=301]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question