S
S
Sergey2021-05-13 15:01:57
htaccess
Sergey, 2021-05-13 15:01:57

How to make a redirect from the product card to a new url?

Good afternoon

We decided to change the url of the product card, we want to make a redirect, but it doesn’t work, tell me how to solve it?

Сейчас: https://domen/catalog/category/sub-cetegory/name-goods/?id=123
Делать редирект на: https://domen/catalog/category/sub-cetegory/products/name-goods/?id=123


All the difference is in the beautiful word /products/

Thank you

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Viktor Taran, 2021-05-13
@oldzas

RewriteCond %{QUERY_STRING} (?:^|&)id\=(.+)(?:$|&)
RewriteRule ^catalog/category/sub\-cetegory/name\-goods/$ /catalog/category/sub\-cetegory/products/name\-goods/\?id=%1 [L,R=301]

D
dodo512, 2021-05-13
@dodo512

RewriteCond %{QUERY_STRING} (^|&)id=123($|&)
RewriteRule ^(catalog/category/sub-cetegory)/(name-goods)/$  https://domen/$1/products/$2/ [R=301,L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question