Forum Moderators: phranque
I can not figure out how to find what has changed.
here is my htaccess contents...
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?example.com(/)?.*$ [NC OR]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?quux.com(/)?.*$ [NC]
RewriteRule .*\.(gif¦jpg¦jpeg¦bmp)$ http://www.example.com/NoHotlinks/NoHotlinks.gif [R,NC]
Right now I have htaccess disabled so my page can be online.
[edited by: jdMorgan at 10:41 pm (utc) on Sep. 21, 2006]
[edit reason] Examplified. [/edit]
However what you've got there is a condition which is triggered if the referrer is not example.com *or* not quux.com. Since the referrer can't be both, one of these conditions will always be true, so the rule will trigger on all image hits where there's a referrer. You should remove the OR so that it's only true if the referrer is neither domain.
RewriteEngine on
RewriteCond %{HTTP_REFERER} .
RewriteCond %{HTTP_REFERER} !^http://(www\.)?example\.com [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?quux\.com [NC]
RewriteRule \.(gif¦jpe?g¦bmp)$ http://www.example.com/NoHotlinks/NoHotlinks.gif [R,NC]
The first RewriteCond is not needed unless your site has a dedicated (non-shared) IP address. It is unnecessary on most name-based virtual servers (shared hosting), which are inaccessible via HTTP/1.0.
Jim