Forum Moderators: phranque
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{HTTP_REFERER}!^http://(www\.)?mysite\.org
RewriteCond %{HTTP_REFERER}!^http://216\.239\.(3[2-9]¦[45][0-9]¦6[0-3]).*(www\.)?mysite\.org [NC]
RewriteCond %{HTTP_REFERER}!^http://216\.243\.113\.1/cgi/
RewriteRule \.(jpe?g¦gif¦bmp¦png)$ images/nohotlinking.gif [NC]
But the original one allowing blank referer, now, won’t stop hotlinking no mater how I try.
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{HTTP_REFERER}!^$
RewriteCond %{HTTP_REFERER}!^http://(www\.)?mysite\.org
RewriteCond %{HTTP_REFERER}!^http://216\.239\.(3[2-9]¦[45][0-9]¦6[0-3]).*(www\.)?mysite\.org [NC]
RewriteCond %{HTTP_REFERER}!^http://216\.243\.113\.1/cgi/
RewriteRule \.(jpe?g¦gif¦bmp¦png)$ images/nohotlinking.gif [NC]
It used to work. Could there be a problem with the way Apache 2.0 was updated and compiled on the server? There was a lot of problems reported to the host with htaccess around that time.
Referer-based access control is a simple, easy, partial solution. It's only good for stopping casual hotlinking in typical cases, and is not a bullet-proof solution. Comprehensive access control must rely on more sophisticated methods, such as cookie-based access-control scripts.
Jim
All I can think of right now is to try:
RewriteCond %{HTTP_REFERER} .
It should not make any difference, though.
I'm assuming you've got the required spaces between "}" and "!" and that posting in the forum is removing them.
Jim