Single RewriteRule convert please

0 down vote favorite

hello everyone, i just installed nginx up and running for serving static
content on my site. it works great but the apache rewrite rule about
images (ofcourse) stoped working.

and i don’t have an idea how to convert .

This is what i was using on apache :

RewriteCond %{HTTP_REFERER} !^http://(www.)?999策略白菜网站 - 999策略白菜论坛网 [NC]
RewriteRule i/image_(\d+).(jpg|jpeg|gif) pic/$1 [L]

Its purpose is to redirect directly accessed images to the image page
instead. Helps is appreciated

Thanks in advance :slight_smile:
cheers

Posted at Nginx Forum:

On Fri, Dec 03, 2010 at 05:52:51AM -0500, wickedsunny wrote:

RewriteCond %{HTTP_REFERER} !^http://(www.)?imgzzz.com/.*$ [NC]
RewriteRule i/image_(\d+).(jpg|jpeg|gif) pic/$1 [L]

Its purpose is to redirect directly accessed images to the image page
instead. Helps is appreciated

This is configuraiton for 0.8.53:

location /i/image_ {

location ~ ^/i/image_(?<IMAGE>\d+)\.(jpg|jpeg|gif)$ {
    valid_referers  imgzzz.com  www.imgzzz.com;

    if ($invalid_referer) {
        rewrite  ^  /pic/$IMAGE;
    }
}

}


Igor S.
http://sysoev.ru/en/

Thank u so much let me give it a try . and will get back to u . cheers

Posted at Nginx Forum: