robertdfeinman
05-20-2005, 03:25 PM
'm trying to block hotlinking of images from just some particular domains.
I've created a .htaccess file as shown below. Some times this seems to work, and sometimes it doesn't. I'm baffled by the inconsistent results.
Here are two successive lines from the log file (wrapped for clarity).
In the first case the image is blocked, but in the second it's not.
I've also had the condition where the image is blocked for one request, but not for a subsequent one from the same site.
Notice the first entry returns a 304 status as expected, but the second yields a 200 and delivers the image even though the domain is the same for both.
Any ideas what's going on?
log file:
------- first request
66.XXXX - - [19/May/2005:10:28:49 -0400]
"GET /panoramic_horizontal/hawaii/maui/images/maui_sunset_hpan.jpg
HTTP/1.1" 304 - "http://www.xanga.com/home.aspx?user=lisalyn"
"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.8)
Gecko/20050511 Firefox/1.0.4"
-------second request
66.XXXX - - [19/May/2005:10:29:16 -0400]
"GET /panoramic_horizontal/scenic/images/sunset_over_water2.jpg
HTTP/1.1" 200 36747 http://www.xanga.com/home.aspx?user=MILESmayLIEbetweenUS"
"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.8)
Gecko/20050511 Firefox/1.0.4"
---- .htaccess file:
RewriteEngine On
RewriteCond %{HTTP_REFERER} ^http://(www\.)?xanga\.com/ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?myspace\.com/ [NC]
RewriteRule \.(jpe?g|gif|bmp|png)$ - [F,L]
---------
Thanks in advance for any suggestions.
I've created a .htaccess file as shown below. Some times this seems to work, and sometimes it doesn't. I'm baffled by the inconsistent results.
Here are two successive lines from the log file (wrapped for clarity).
In the first case the image is blocked, but in the second it's not.
I've also had the condition where the image is blocked for one request, but not for a subsequent one from the same site.
Notice the first entry returns a 304 status as expected, but the second yields a 200 and delivers the image even though the domain is the same for both.
Any ideas what's going on?
log file:
------- first request
66.XXXX - - [19/May/2005:10:28:49 -0400]
"GET /panoramic_horizontal/hawaii/maui/images/maui_sunset_hpan.jpg
HTTP/1.1" 304 - "http://www.xanga.com/home.aspx?user=lisalyn"
"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.8)
Gecko/20050511 Firefox/1.0.4"
-------second request
66.XXXX - - [19/May/2005:10:29:16 -0400]
"GET /panoramic_horizontal/scenic/images/sunset_over_water2.jpg
HTTP/1.1" 200 36747 http://www.xanga.com/home.aspx?user=MILESmayLIEbetweenUS"
"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.8)
Gecko/20050511 Firefox/1.0.4"
---- .htaccess file:
RewriteEngine On
RewriteCond %{HTTP_REFERER} ^http://(www\.)?xanga\.com/ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?myspace\.com/ [NC]
RewriteRule \.(jpe?g|gif|bmp|png)$ - [F,L]
---------
Thanks in advance for any suggestions.