Web Servers on Unix and Linux - mod rewrite problem

This is Interesting: Free IT Magazines  
Home > Archive > Web Servers on Unix and Linux > July 2006 > mod rewrite problem





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author mod rewrite problem
Robert Feinman

2006-07-26, 1:20 pm

I'm a terrible proofreader so there is probably something
obvious with why this line doesn't work, but I don't see it.

RewriteCond %{HTTP_REFERER} ^http://(www\.)allman*\.com/ [NC,OR]
....
RewriteRule \.(jpe?g|gif|bmp|png)$ - [F,L]


It's supposed to block sites like:
http://allmanbrothersband.com/
http://www.allmanbrothersband.com/
http://www.allmanbrothers.com/
http://allmanbrothers.com/

(I don't have anything against the band, just fans who
are stealing my pictures to use in their messages).
Similar lines in the mod rewrite clause work properly.
Thanks in advance...

--
Robert D Feinman
Landscapes, Cityscapes and Panoramic Photographs
http://robertdfeinman.com
mail: robert.feinman@gmail.com
Eric Schwartz

2006-07-27, 1:19 am

Robert Feinman <robert.feinman@gmail.com> writes:
> I'm a terrible proofreader so there is probably something
> obvious with why this line doesn't work, but I don't see it.
>
> RewriteCond %{HTTP_REFERER} ^http://(www\.)allman*\.com/ [NC,OR]


You probably want:

RewriteCond %{HTTP_REFERER} ^http://(www\.)allman.*\.com/ [NC,OR]

(completely untested)

Your first rule said, in part, "match anything with the letters
'allma', and 0 or more 'n's."

-=Eric
Robert Feinman

2006-07-27, 1:20 pm

In article <87r7082p3j.fsf@localhost.localdomain>, emschwar@pobox.com
says...
> Robert Feinman <robert.feinman@gmail.com> writes:
>
> You probably want:
>
> RewriteCond %{HTTP_REFERER} ^http://(www\.)allman.*\.com/ [NC,OR]
>
> (completely untested)
>
> Your first rule said, in part, "match anything with the letters
> 'allma', and 0 or more 'n's."
>
> -=Eric
>

Thanks that seems to have done it. I always forget about the "."
(Too many versions of pattern matching syntax around).
--
Robert D Feinman
Landscapes, Cityscapes and Panoramic Photographs
http://robertdfeinman.com
mail: robert.feinman@gmail.com
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com