K
K
Konstantin2015-10-26 19:27:21
htaccess
Konstantin, 2015-10-26 19:27:21

How to 301 redirect a directory in htaccess?

Good afternoon! As a result of finalizing the product catalog, the url of the product card has changed from :
www.site.ru/product/product to www.site.ru/catalog/product/product
Some of the pages were indexed, most of them were not.
Please tell me how to make a 301 redirect from the old CNC product to the new one, i.e. add /catalog/?
Probyval

RewriteRule product/(.*) catalog/product/$1 [R=301,L]

But it adds /catalog/ to the cnc with catalog/product/, i.e. makes www.site.ru/catalog/catalog/product/product

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Z
zooks, 2015-10-26
@zooks

RewriteRule product/(.*) /catalog/product/$1 [R=301,L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question