Rewrite rule for nginx from Apache

Denis F. Latypoff denis at gostats.ru
Thu Nov 19 14:04:10 MSK 2009


Hello Robert,

Thursday, November 19, 2009, 4:28:17 PM, you wrote:

> Thx, can u also help me with this:

> RewriteCond   %{REQUEST_URI} \/([0-9a-z]{6})$ [NC]
> RewriteRule   ^(.*) http://www.example.com/forward.php?%1 [L]

> Thanks again!

location ~ "/(?<fwd>[0-9a-z]{6})$" {
    rewrite ^ http://www.example.com/forward.php?$fwd last;
}

or

location ~ "^/(?<fwd>[0-9a-z]{6})$" {
    rewrite ^ http://www.example.com/forward.php?$fwd last;
}


-- 
Best regards,
 Denis                            mailto:denis at gostats.ru






More information about the nginx mailing list