View Single Post
Old 11-07-2008, 12:00 AM  
Turboface
Back in Black
 
Turboface's Avatar
 
Industry Role:
Join Date: Mar 2002
Posts: 9,976
Have your host install mod_geoip on your server and then put this as your .htaccess file.

Code:
GeoIPEnable On
GeoIPDBFile /path/to/GeoIP.dat

# Redirect one country
RewriteEngine on
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^CA$
RewriteRule ^(.*)$ http://www.canada.com$1 [L]

# Redirect multiple countries to a single page
RewriteEngine on
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^(CA|US|MX)$
RewriteRule ^(.*)$ http://www.northamerica.com$1 [L]
http://www.maxmind.com/app/mod_geoip

Turboface is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote