Answer the question
In order to leave comments, you need to log in
How to implement 301 redirect for rules?
For the first time I come across a redirect and it is difficult to imagine its capabilities. Therefore, the next question)
The site was transferred from joomla to bitrix.
1) If the link contains "/magazin/browse/manufacturer/", then replace it with "/manufacturer/"
2) If the link contains "/magazin/category/product/", then replace it with "/catalog/product/" and delete the content until the next "/"
3) If the link contains "/magazin/category/manufacturer/#SECTION_CODE#/#XML_ID#.html", then form the link "/catalog/#SECTION_CODE#/filter/brands_ref-is- #XML_ID#/apply/"
4) If the link contains "/magazin/category/", then replace it with "/catalog/"
Will these rules conflict with each other?
Answer the question
In order to leave comments, you need to log in
No, they won't if you hardcode the logic.
For the sweet life
https://donatstudios.com/RewriteRule_Generator
Your question
RewriteCond %{REQUEST_URI} ^(.*)/dir1/(.*)$
# если строка содержит /dir1/
RewriteRule ^(.*)$ %1/dir2/%2 [R=301,L]
#Перенаправить все урлы с начинающиеся с dir1 на dir2 с сохранением дальнейшей структуры URL
RewriteCond %{REQUEST_URI} ^(.*)/magazin/category/manufacturer(/|)$
RewriteCond %{REQUEST_URI} !^/magazin/category/manufacturer/#SECTION_CODE#/#XML_ID#.html$
RewriteRule ^(.*)$ %1/dir2/%2 [R=301,L]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question