begin  quoting Joshua Penix as of Fri, Sep 08, 2006 at 08:26:58AM -0700:
[snip]
> Although referrals from Google.com are top on the list, referrals  
> from other foreign Google.<country> sites make up quite a chunk.   
> I've added rules to make Apache deny anyone coming to us via those  
> foreign Googles.  My list is not complete, but I used the top 20 list  
> on Webalizer to guide me.  If someone has a text processing itch and  
> wants to parse the complete list of official Google sites (http:// 
> www.google.com/supported_domains) into the following format:
> 
> RewriteCond %{HTTP_REFERER} ^http://www.google.pl [OR]
> RewriteCond %{HTTP_REFERER} ^http://www.google.com.au [OR]
> 
> I'd be more than happy to paste the entire list into our config.

Like this?

-----------------------------------------------------------------------------
RewriteCond %{HTTP_REFERER} ^http://www.google.ae [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.com.af [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.com.ag [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.off.ai [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.am [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.com.ar [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.as [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.at [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.com.au [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.az [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.ba [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.com.bd [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.be [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.bg [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.com.bh [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.bi [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.com.bo [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.com.br [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.bs [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.co.bw [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.com.bz [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.ca [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.cd [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.cg [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.ch [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.ci [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.co.ck [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.cl [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.cn [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.com.co [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.co.cr [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.com.cu [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.cz [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.de [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.dj [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.dk [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.dm [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.com.do [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.com.ec [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.com.eg [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.es [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.com.et [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.fi [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.com.fj [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.fm [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.fr [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.gg [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.com.gi [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.gl [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.gm [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.gr [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.com.gt [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.com.hk [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.hn [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.hr [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.ht [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.co.hu [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.co.id [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.ie [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.co.il [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.co.im [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.co.in [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.is [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.it [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.co.je [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.com.jm [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.jo [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.co.jp [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.co.ke [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.kg [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.co.kr [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.kz [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.li [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.lk [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.co.ls [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.lt [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.lu [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.lv [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.com.ly [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.co.ma [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.md [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.mn [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.ms [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.com.mt [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.mu [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.mw [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.com.mx [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.com.my [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.com.na [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.com.nf [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.com.ni [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.nl [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.no [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.com.np [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.nr [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.nu [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.co.nz [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.com.om [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.com.pa [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.com.pe [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.com.ph [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.com.pk [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.pl [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.pn [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.com.pr [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.pt [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.com.py [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.com.qa [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.ro [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.ru [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.rw [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.com.sa [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.com.sb [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.sc [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.se [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.com.sg [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.sh [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.si [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.sk [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.sn [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.sm [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.com.sv [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.co.th [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.com.tj [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.tm [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.to [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.tp [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.com.tr [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.tt [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.com.tw [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.com.ua [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.co.ug [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.co.uk [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.com.uy [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.co.uz [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.com.vc [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.co.ve [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.vg [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.co.vi [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.com.vn [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.vu [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.ws [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.co.za [OR]
RewriteCond %{HTTP_REFERER} ^http://www.google.co.zm [OR]
-----------------------------------------------------------------------------

Perl was a big gun for this sort of thing.

-----------------------------------------------------------------------------
#!/bin/csh -f

set RWCND = "RewriteCond %{HTTP_REFERER}"

mkdir /tmp/$$
pushd /tmp/$$

wget http://www.google.com/supported_domains

touch exclude_list
foreach i ( `cat supported_domains | grep -v '^\.google\.com$'` )
   echo "$RWCND ^http://www$i [OR]" >> exclude_list
end

popd
cp /tmp/$$/exclude_list ./
-----------------------------------------------------------------------------

-- 
_ |\_
 \|

-- 
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-steer

Reply via email to