On Thu, 29 Jul 2004 21:48:00 GMT, Justin Koivisto <spam RemoveThis @koivi.com> wrote:
> Grytpype-Thynne wrote:
>
>> Hi,
>> How do I get to write the following as one line?
>> RewriteCond %{HTTP_REFERER} !^http://images.google.co.uk/.*$ [NC]
>> RewriteCond %{HTTP_REFERER} !^http://images.google.co.uk$ [NC]
>> RewriteCond %{HTTP_REFERER} !^http://images.google.com.au/.*$ [NC]
>> RewriteCond %{HTTP_REFERER} !^http://www.google.co.jp/.*$ [NC]
>> RewriteCond %{HTTP_REFERER} !^http://images.google.fr/.*$ [NC]
>> RewriteCond %{HTTP_REFERER} !^http://images.google.at/.*$ [NC]
>> RewriteCond %{HTTP_REFERER} !^http://images.google.de/.*$ [NC]
>> RewriteCond %{HTTP_REFERER} !^http://images.google.nl/.*$ [NC]
>> RewriteCond %{HTTP_REFERER} !^http://images.google.ca/.*$ [NC]
>> RewriteCond %{HTTP_REFERER} !^http://images.google.se/.*$ [NC]
>> RewriteCond %{HTTP_REFERER} !^http://images.google.pl/.*$ [NC]
>> RewriteCond %{HTTP_REFERER} !^http://images.google.it/.*$ [NC]
>> RewriteCond %{HTTP_REFERER} !^http://images.google.fi/.*$ [NC]
>
> *not* *tested*
>
> RewriteCond %{HTTP_REFERER}
> !^http://(images\.google\.(co\.uk|com\.au|fr|at|de|nl|ca|se|pl|it|fi)/?.*|www\.google\.co\.jp)$
> [NC]
>
That one <a style='text-decoration: underline;' href="http://www.google.co.jp" target="_blank">www.google.co.jp</a> sure makes a mess of it :/
It seems like you are setting up for a rule which applies if the request
*isn't* coming from images.google.(ad nauseum). It also looks like you
are *allowing* requests from images.google.com, is this correct? Then two
short rules can replace all of these:
RewriteCond %{HTTP_REFERER}
!^http://(images\.google\.|www\.google\.co\.jp) [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://images\.google\.com/.*$ [NC]
Note, if you just want to negate all referers from images.google.anything,
just use the first line without the ,OR. Like Justin's, not tested.
Grey
--
The technical axiom that nothing is impossible sinisterly implies the
pitfall corollary that nothing is ridiculous.
- <a style='text-decoration: underline;' href="http://www.greywyvern.com/webslavent.php?msg=53" target="_blank">http://www.greywyvern.com/webslavent.php?msg=53</a> - Opera puffin mascot
campaign!<!-- ~MESSAGE_AFTER~ -->
>> Stay informed about: htaccess question