|
|
|
|
||||||
| comp.info.servers.unix Web servers for UNIX platforms. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
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. |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
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 |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
|
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
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 |
|
![]() |
| Outils de la discussion | |
|
|