rewrite rules

Stefanita rares Dumitrescu lists at ruby-forum.com
Fri Jan 25 15:22:15 MSK 2008


Stefanita rares Dumitrescu wrote:
> hi guys,
> 
> can anyone please translate for me the below rewrite rules? regex and
> rewrite is not my best quality unfortunately :( i know about rtfm ...
> but it's just a thing that doesn't stick with me.
> 
> RewriteEngine on
> RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?domain1.net [NC]
> RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?domain2.net [NC]
> RewriteRule \.(zip|mp3)$ - [NC,F,L]

RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://domain.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://domain.com$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.domain.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.domain.com$      [NC]
RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ http://www.domain.com [R,NC]


in case anyone is wondering what is this, it's hotlinking protection.
i can do anything else but rewrite :)


-- 
Posted via http://www.ruby-forum.com/.





More information about the nginx mailing list