View Single Post
Old 06-25-2003, 04:04 AM  
andi_germany
Confirmed User
 
Join Date: Oct 2002
Location: Germany
Posts: 768
If you use maxminds geo-ip database don't be cheap and get the premium country service. If you use their free database e.g. AOL is taken as US even if you use AOL Germany or other countries.

I use the apache module and use php to forward certain IP blocks.

$country_code = apache_note("GEOIP_COUNTRY_CODE");
switch($country_code) {
case 'A1':
case 'IN':
case 'PK':
case 'CN':
case 'ID':
case 'MY':
case 'PH':
case 'TH':
case 'IR':
case 'LK':
.
.
.
case 'BA':
case 'EE':
case 'SK':
case 'LT':
case 'LV':
case 'KZ':
case 'TM':
case 'KG':
case 'MK':
case 'RO':
case 'UZ':
case 'AL':
case 'CU':
header('Location: http://www.yourdomain.com/cgi-bin/forward.pl');
exit();
break;
default:
break;
}


Case is faster than if clauses. It takes all the countries until a break is displayed so you have less code and you can block forward certeain countries. I then use a perl prog to forward the
traffic to different sponsors or toplists or whatever. The advantage is that the perl prog is not called everytime and noone even notices that he is forwarded.
__________________
SIG TOO BIG! Maximum 120x60 button and no more than 3 text lines of DEFAULT SIZE and COLOR. Unless your sig is for a GFY top banner sponsor, then you may use a 624x80 instead of a 120x60.
andi_germany is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote