K
K
Kirill Sirenko2017-03-09 11:54:24
Apache HTTP Server
Kirill Sirenko, 2017-03-09 11:54:24

Setting up 301 redirects in htaccess Opencart - how to make it work?

CNC is configured on the site (standard Opencart), however, the old urls of this kind:
zhylety?product_id=61
continue to work, now they work the same way.
zhylety/zhiletprofi16
If you write a 301 redirect:

Redirect 301 /index.php?route=product/product&path=57&product_id=61 http://site.ru/zhylety/zhiletprofi16

or like this
Redirect 301 /zhylety?product_id=61 http://site.ru/zhylety/zhiletprofi16

Is it possible to register such redirects automatically for all products, or at least manually, but they do not work. How to make them work?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Taran, 2017-03-09
@shambler81

get request is not part of the url

# 301 --- http://site.ru/index.php?route=product/product&path=57&product_id=61 => http://site.ru/zhylety/zhiletprofi16
RewriteCond %{QUERY_STRING} (^|&)route\=product/product($|&)
RewriteCond %{QUERY_STRING} (^|&)path\=57($|&)
RewriteCond %{QUERY_STRING} (^|&)product_id\=61($|&)
RewriteRule ^index\.php$ /zhylety/zhiletprofi16? [L,R=301]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question