news

contact

support
Home SSL Certificates Web Hosting Plans VPS Plans Dedicated Servers

Look Up a Domain
World Wide Web Pointer

MarkerReserve Your Domain!
Free Web HostingResellersFrequently Asked Questions

GeoIP Web Hosting
MaxMind Logo

MaxMind GeoIP technology is built into all of the hosting servers here. It can be used to block and redirect traffic from certain countries. This is useful for sites that have specific geographical targeting requirements. ModGeoIP is built into the Apache web server and PHP. It is configurable via the .htaccess file and the PHP API. It is IPv6 compatible. There is a list of country codes along with specific syntax examples available in the knowledgebase. DIY people and experienced users can use the samples shown below to get an idea of how this technology is implemented. If preferred, open a support ticket and the configuration will be done for you. This type of support is included with all hosting plans.

There are different reasons for using geolocation. One example is when copyrighted content is only licensed for consumption in a specific country. Another possibility is when a website has different language versions to dislay to people in differnet localities. There are also large or busy services with a need to route visitors to the nearest physical server. In some cases, government embargoes can prevent a company from being allowed to sell goods and services to some areas. Geotargeting is helpful in all of these cases.

Type of GeoIP Installations: mod_geoip for Apache & GeoIP PHP API


The following is an example of .htaccess code to block the United States, Canada and the United Kingdom:

RewriteEngine On
SetEnvIf GEOIP_COUNTRY_CODE US BlockCountry
SetEnvIf GEOIP_COUNTRY_CODE CA BlockCountry
SetEnvIf GEOIP_COUNTRY_CODE UK BlockCountry
Deny from env=BlockCountry

Below is an example of how to redirect traffic from a certain ISO 3166 code to a new page, in thise case Great Britain:

RewriteEngine On
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^GB$
RewriteRule ^(.*)$ http://www.example.com/gb.html$1 [L]

To only allow traffic from Ireland:

RewriteEngine On
SetEnvIf GEOIP_COUNTRY_CODE IE AllowCountry
Deny from all
Allow from env=AllowCountry

Here is a way to pull information about the location of www.example.com using PHP and put it into an array:

<?php
$cntry = geoip_record_by_name('www.example.com');
if ($cntry) {
    print_r($cntry);
}
?>