Hello, I did a little rewrite rule a little while ago to redirect ppl who directly access my site's image to image pages instead,
for example a person accessing to
this is the rewrite rule i used :
location /i/image_(\d+).(gif|jpg|jpeg|png)$ {
root /home/mysite/public_html;
valid_referers www.mysite.com mysite.com;
if ($invalid_referer) {
rewrite ^ permanent;
}
} I made a subdomain of the directory 'i' which contains all the images. so its like thsi now mysite.com/
I tried this but didn't worked :(
location i.imgzzz.com/image_(\d+).(gif|jpg|jpeg|png)$ {
root /home/imgzzz/public_html/i;
valid_referers www.i.imgzzz.com i.imgzzz.com;
if ($invalid_referer) {
rewrite ^ http://www.imgzzz.com/pic/$1 permanent;
}
} Is it possible to make a rewrite like the one above so if the file is directly accessed by a different referer it will hit the same rewrite rule ?
thx :)