rewrite N|next flag in apache

layneuks nginx-forum at
Thu Jan 5 10:17:24 UTC 2012

Hi everyone,

I'm writing here because i have rewrite problems on Nginx. First of all
i will explain to you what result i'm expecting.
For example i have this URL :

after rewrite i would like to get :

So i get it works on apache with : 

$1$4/?&$2=$3 [QSA,N]
RewriteRule ^api/redirect/[^\/]+/[^\/]+/([^\/]+)
index.php?service=Redirect&hash=$1 [QSA,L]

And now i would like to have the same on nginx, but i think nginx
doesn't handle something like apache's N flag. Then it's my nginx
rewrite rules, it work once because it doesn't re-execute rewrite while
it's possible.

 rewrite ^/(api/redirect/[^\/]+/[^\/]+/[^\/]+)/([^\/]+)/([^\/]+)([^\?]*)
 rewrite ^/api/redirect/[^\/]+/[^\/]+/([^\/]+)
/public/index.php?service=Redirect&func=Redirect&hash=$1 last;

Do someone have a solution for this please ? I will apreciate a lot.
thanks you.

Best regards,

Posted at Nginx Forum:,220833,220833#msg-220833

More information about the nginx mailing list