PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Hébergement serveur > comp.info.servers.unix > htaccess problem
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
comp.info.servers.unix Web servers for UNIX platforms.

htaccess problem

Réponse
 
LinkBack Outils de la discussion
Vieux 19/05/2005, 15h42   #1
Robert Feinman
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut htaccess problem

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
  Réponse avec citation
Vieux 20/05/2005, 08h47   #2
chris-usenet@roaima.co.uk
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: htaccess problem

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
  Réponse avec citation
Vieux 20/05/2005, 14h21   #3
Robert Feinman
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: htaccess problem

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
  Réponse avec citation
Vieux 20/05/2005, 14h54   #4
Paul Rubin
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: htaccess problem

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.
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 18h01.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,10413 seconds with 12 queries