Web Design & Development, Branding & Marketing Delivering by a leading Birmingham Agency

Share this
 

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

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

The MEDIAMAKS UK 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 MEDIAMAKS UK CDN is available on our shared Web HostingWordPress HostingReseller Hosting and Managed VPS.

REQUEST A QUOTE