I know about the HttpRewriteModule, but I don't really know how to handle regex and I would need to redirect all URLs within a certain directory to another, specifically:
From: example.com/component/tag/whatever
To: example.com/tag/whatever
Could some one tell me how to do this in Nginx?
Do you mean something like:
Depending where you define the
rewrite
directive you have two ways to implement it:A. In the
server
contextB. In the
location
contextTeo, why did you change the flag
last
tobreak
? Because, if this directive is put inside of alocation
context, thelast
flag will makenginx
to run 10 cycles and return the 500 error.