Apache GeoIP is an apache module for detecting your visitor’s IP and block/redirect them to another website. Installing and configuring GeoIP is very easy in Ubuntu. Here are the steps :
1.Install the Apache GeoIP module and restart apache webserver
2.Create the .htaccess file and put in your webroot folder / website folder
1 2 3 4 5 6
In the example above, GeoIP will check whether the visitor is from Australia or not. If the visitor is from Australia then apache will redirect the visitor to http://www.canada.com. Quite simple and straight forward. You can see another example in here http://www.maxmind.com/app/mod_geoip ( ignore the GeoIPDBFile because it will cause error ).