Answer the question
In order to leave comments, you need to log in
Redirecting product pages to Bitrix and cyclic redirection?
There are product pages: https://site.ru/katalog/ section -name /product-name/
And brand pages: https://site.ru/katalog/ section -name /brand-brand-name/ It is
necessary to redirect the products to this format: https://site.ru/katalog/ product /product-name/ I
wrote a redirect like this:
RewriteRule ^(.*)katalog/(.*)/(.*)/$ https://site.
ru/
katalog /product/$3/ [R=301,L] redirect from katalog to katalog
How can I solve this problem without affecting brand pages?
Answer the question
In order to leave comments, you need to log in
RewriteRule ^katalog/(?!product/)[^/]+/(?!brand-)([^/]+)/$ https://site.ru/katalog/product/$1/ [R=301,L]
RewriteCond $2 !=product
RewriteCond $3 !^brand-
RewriteRule ^(katalog)/([^/]+)/([^/]+)/$ https://site.ru/$1/product/$3/ [R=301,L]
the product page cannot be in the "brand" category because it can be linked to several categories at once.
For example:
карсный / для дома/ две дверцы/1товар
зеленый / для дома/ две дверцы/1товар
Холодильник / дешевый/размер 1x2/ две дверцы/ со скидкой
Встраиваемый/товар
И тд
RewriteCond %{REQUEST_URI} !katalog/product$
RewriteRule ^katalog/(.*+[^/])/(.+[^/])/$ https://site.ru/katalog/product/$2/ [R=301,L]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question