need rewrite help

António P. P. Almeida appa at perusio.net
Tue Sep 20 21:50:44 UTC 2011


On 20 Set 2011 22h38 WEST, nginx-forum at nginx.us wrote:

> Hi,
>
> please help me to rewrite this mod_rewrite rule:
>

> RewriteRule    (img/(.+))$ webroot/$1     [L]

Try:

location ^~ /img/ {
    location ~* /img/(.+)$ {
       return 301 /webroot/$1;
   }
}

Or 302 if you want it to be temporary.

--- appa



More information about the nginx mailing list