How do I redirect a user based on their location and IP address?

The D2M Hosting CDN nodes have inbuilt support for GeoIP. 

This means that each request gets an X-Country HTTP Header set which can be used to redirect traffic from specific countries. 

For example, if you wanted to redirect UK traffic that hits the '.com' version of your site you could add this in a .htaccess file. 

RewriteCond %{HTTP:X-Country} UK [nc]

RewriteRule (.*) http://my-new-domain.co.uk/$1 [L,R=302]

The free D2M Hosting CDN is available on our shared Web Hosting, WordPress Hosting, Reseller Hosting and Managed VPS.

  • IP address, location, redirect, user based, CDN
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How long is website data cached for at a CDN node?

The CDN itself is used to cache static content. By default, the following file types are cached...

Pages that receive a cache BYPASS

There'll always be some pages that you'll rarely ever want to cache. On some of these pages, we...

What is the Website Acceleration Suite?

  Overview D2M Hosting's CDN powers-up your websites further by feeding them through our...

CDN Statistics

With the free D2M Hosting CDN, you can get an understanding about the traffic and requests...

Do I need caching plugins in addition to the D2M Hosting CDN?

The short answer is no, the D2M Hosting Content Delivery Network takes care of caching for you....

Powered by WHMCompleteSolution