URL redirection without .html suffix

I have an old website with a url like:

/my-category/my-product

and on my new website I managed to keep part of the category the same in many cases (but not all), but I want to redirect my old products that do not have the suffix .html to the category.

So it /my-category/my-productwill be redirected to /my-category/, but /my-category/my-product.htmlwill be ignored, as it has .htmlat the end. New website products are .htmlat the end where the old website is down.

I also need to stop processing additional rules.

+4
source share
1 answer

\, , . url html.

^(/[\w-]+)+$

0

Source: https://habr.com/ru/post/1667005/


All Articles