Answer the question
In order to leave comments, you need to log in
301 redirect on the site?
Hi all. Please tell me how to make a correct redirect through htaccess in this case. The links were like mysite.ru/katalog-tovarov/vannyi-chugunnyie/ and now the directory is not in the new structure. That is, the links will all be of the form mysite.ru/vannyi-chugunnyie/. And so on the whole site. That is, you need to skip the katalog-products section through a 301 redirect. Thank you!
Answer the question
In order to leave comments, you need to log in
RewriteRule ^(.*)/old-catalog/(.*)$ $1/new-catalog/$2 [R=301,L]
RedirectMatch 301 /katalog-tovarov/vannyi-chugunnyie/(.*) /vannyi-chugunnyie/$1
RewriteCond %{REQUEST_URI} ^(.*)/dir1/(.*)$
# если строка содержит /dir1/
RewriteRule ^(.*)$ %1/dir2/%1 [R=301,L]
#Перенаправить все урлы с начинающиеся с dir1 на dir2 с сохранением дальнейшей структуры URL
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question