Answer the question
In order to leave comments, you need to log in
Question about htaccess regular expressions?
Hello,
You need to make a redirect for categories, for example: https://mysite.ru/123-cats
to https://mysite.ru/shop/cats
and from the product page, for example: https://mysite.ru/cats/834-whiskas.html
to https://mysite.ru/product/whiskas
Tell me what the RewriteRule will look like for these two rules
Answer the question
In order to leave comments, you need to log in
At
you have a cyclic redirect, because /product/$1 matches regex ^/.*/([0-9]-.*\.html)$
you need to make stricter rules..
RewriteCond %{REQUEST_URI} !^/product [NC] # если не начинается с /product
RewriteRule ^/.*/([0-9]-.*\.html)$ /product/$1 [R=301,L]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question