P
P
Pavel Sidorov2021-06-03 15:59:05
htaccess
Pavel Sidorov, 2021-06-03 15:59:05

How to make mass redirects in a directory?

Let's say two links

/product/kolpachkovaya-kolonna-mednaya (old site)
and
/product-category/dlya-samogonshhika/alambiki-mednye/kolpachkovaya-kolonna-mednaya/ (new site)

directory is healthy. Tell me how to make a mass redirect from the old to the new . in fact, we have the same only symbolic product code.

Thanks.

I guess it's possible to go this way, but how do I replace nested categories with regular expressions?
in this example, you need to add to the regular expressions
dlya-samogonshhika/alambiki-mednye

RewriteEngine   on
RewriteBase     /
RewriteRule     ^product/(.*)$  product-category/РЕГУЛЯРКА/РЕГУЛЯРКА/$1 [R=301]

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Taran, 2021-06-03
@shambler81

It is not entirely clear which of them was what became.
Give me a couple of links, just as it was, it has become
There are no problems with regular expressions, everything can be inserted there

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question