Skip to main content
< All Topics
Print

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

Share with:


The CDN nodes have inbuilt support for GeoIP. 

This means that each request gets a 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 CDN is available on our shared Web Hosting, WordPress Hosting, and Managed Hosting.

Table of Contents