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 > Apache Rewrite Question
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
comp.info.servers.unix Web servers for UNIX platforms.

Apache Rewrite Question

Réponse
 
LinkBack Outils de la discussion
Vieux 25/05/2006, 22h23   #1
phil@1918.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Apache Rewrite Question

Okay, I'm stumped.

I have what I thought was an easy job to do. I want to keep one site
from pulling a picture from my site.

I already have another rewrite in place to do some watermarking of
other images.

Here's my snippet of rewrite:

RewriteEngine on
#RewriteCond %{HTTP_REFERER} ^http://www.severinfilm.hu/
#RewriteRule .*\.jpg$ /babe_stealer.jpg [R,L]
#RewriteRule ^/watermark.* /babe_stealer.jpg [R,L]

RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://mysite.com/ [NC]
RewriteRule ^/watermark.php?image=(babe_.*\.jpg)$
/watermark.php?image=babes/$1 [
R]
RewriteRule ^/images/(babe_.*\.jpg)$ /watermark.php?image=babes/$1
[R]

Although I have the top three commented out right now, they are the
ones that have me confused. All I'm attempting to do is... if the
request comes from that domain, serve up an alternate image, if the
request doesn't come from that domain or mysite, go ahead and watermark
my images.

When I enable the top three lines, all other domains get the alternate
image, not just the one specified. Since I'm on day 2, I know it must
be something easy I'm missing.

Any and all appreciated.

  Réponse avec citation
Vieux 26/05/2006, 11h36   #2
Robert Ionescu
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Apache Rewrite Question

phil@1918.com wrote:
> I have what I thought was an easy job to do. I want to keep one site
> from pulling a picture from my site.


Have a try on

RewriteEngine on
RewriteCond %{HTTP_REFERER} ^http://(www\.)?severinfilm\.hu/
# allow that image
RewriteConde %{REQUEST_URI} !^/babe_stealer\.jpg$
# Request either ends with .jpg or starts with /watermark
RewriteRule (^/watermark|\.jpg$) /babe_stealer.jpg [R,L]

RewriteCond %{HTTP_REFERER} !=""
RewriteCond %{HTTP_REFERER} !^http://(www\.)?mysite\.com/ [NC]
# the request was e.g. /images/babe_abc.jpg, served now by
# /watermark.php?image=babes/babe_abc.jpg) (why are you using the R-Flag
# here? you could keep this as an internal rewrite.
RewriteRule ^/images/(babe_.*\.jpg)$ /watermark.php?image=babes/$1 [R,L]

--
Robert
  Réponse avec citation
Vieux 26/05/2006, 11h36   #3
Robert Ionescu
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Apache Rewrite Question


  Réponse avec citation
Vieux 26/05/2006, 11h36   #4
Robert Ionescu
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Apache Rewrite Question

phil@1918.com wrote:
> I have what I thought was an easy job to do. I want to keep one site
> from pulling a picture from my site.


Have a try on

RewriteEngine on
RewriteCond %{HTTP_REFERER} ^http://(www\.)?severinfilm\.hu/
# allow that image
RewriteConde %{REQUEST_URI} !^/babe_stealer\.jpg$
# Request either ends with .jpg or starts with /watermark
RewriteRule (^/watermark|\.jpg$) /babe_stealer.jpg [R,L]

RewriteCond %{HTTP_REFERER} !=""
RewriteCond %{HTTP_REFERER} !^http://(www\.)?mysite\.com/ [NC]
# the request was e.g. /images/babe_abc.jpg, served now by
# /watermark.php?image=babes/babe_abc.jpg) (why are you using the R-Flag
# here? you could keep this as an internal rewrite.
RewriteRule ^/images/(babe_.*\.jpg)$ /watermark.php?image=babes/$1 [R,L]

--
Robert
  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 04h26.


É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,11859 seconds with 12 queries