Hi, I'm trying to redirect and / or rewrite a set of URLs.
Example:
misitio.com/categoria1 --> misitio.com/categoria1.html
For now I have this, which correctly rewrites this first level:
RewriteRule ^categoria1/(\w+)$ $1.html [QSA,L]
However, I can not find the conditional regular expression if there were more nested categories and I had to take the last one as a model for the exit URL.
Example:
misitio.com/categoria1/categoria2/categoria3 --> misitio.com/categoria3.html
Or
Example:
misitio.com/categoria1/categoria2/categoria3/categoria4/categoria5/ --> misitio.com/categoria5.html
Can someone give me a cable? Thanks!