Answer the question
In order to leave comments, you need to log in
Mod_rewrite - How to redirect the last level folder to the first?
Please help me write a 301 redirect rule.
There is a product catalog with multi-level nesting of headings (catalogues) urls. We decided to move them to 1 nesting level. But to make it easier for Search Engines, you need to create a redirect rule.
For example:
/catalog/group1/group2/ -> /catalog/group2/
/catalog/group1/group2/group3/ -> /catalog/group3/
i.e. nesting is different and it must be brought to the same level.
Don't touch urls that end in .html
In general, I don't understand how to write RewriteCond to get the name of the last folder if it's more than 1 level of nesting.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question