|
|
|
|
||||||
| comp.info.servers.unix Web servers for UNIX platforms. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
I'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. 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. -- Robert D Feinman Landscapes, Cityscapes and Panoramic Photographs http://robertdfeinman.com mail: robertdfeinman@netscape.net |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
Robert Feinman <robertdfeinman@netscape.net> wrote:
> 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. > Any ideas what's going on? > RewriteCond %{HTTP_REFERER} ^http://(www\.)?xanga\.com/ [NC,OR] > RewriteCond %{HTTP_REFERER} ^http://(www\.)?myspace\.com/ [NC] There's no requirement for a browser to tell you the referrer, and even if it does it might be spoofed. Basically, you shouldn't rely on it. Chris |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
In article <6ah0m2-cu5.ln1@news.roaima.co.uk>, chris-usenet@roaima.co.uk
says... > Robert Feinman <robertdfeinman@netscape.net> wrote: > > 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. > > > Any ideas what's going on? > > > RewriteCond %{HTTP_REFERER} ^http://(www\.)?xanga\.com/ [NC,OR] > > RewriteCond %{HTTP_REFERER} ^http://(www\.)?myspace\.com/ [NC] > > There's no requirement for a browser to tell you the referrer, and even > if it does it might be spoofed. Basically, you shouldn't rely on it. > > Chris > That's not the problem. The problem is that for requests where the referrer matches the conditions above the rewrite is not taking place. I'm not trying to block everything, just the ones I listed. -- Robert D Feinman Landscapes, Cityscapes and Panoramic Photographs http://robertdfeinman.com mail: robertdfeinman@netscape.net |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
Robert Feinman <robertdfeinman@netscape.net> writes:
> That's not the problem. The problem is that for requests where the > referrer matches the conditions above the rewrite is not taking place. > I'm not trying to block everything, just the ones I listed. Setting the rewrite log level to 9 and examining the log output is often useful in debugging this type of problem. |
|
![]() |
| Outils de la discussion | |
|
|