0

We have a .co.uk website that is up and running with no problems, we've just bought the .london domain. What we'd like to do is to redirect users to the .london site depending on their physical location when clicking through.

Is there a piece of code that could detect the nearest web server and use that information to decide whether to send to .co.uk or .London?

bcmcfc
  • 25,966
  • 29
  • 109
  • 181
Marodo
  • 111
  • 1
  • 10
  • possible duplicate of [Is it possible to determine the user locale's \*\*country\*\* as set in the OS from the browser in JavaScript?](http://stackoverflow.com/questions/11826149/is-it-possible-to-determine-the-user-locales-country-as-set-in-the-os-from) – logixologist Sep 19 '14 at 13:16

2 Answers2

0

You can use a service like geobytes to detect the location and redirect based on it.

The URL is:

https://secure.geobytes.com/IpLocator.htm?GetLocation&template=php3.txt&IpAddress=x.x.x.x&pt_email=someone@example.com&pt_password=xxxxxxxxxx
Praveen Kumar Purushothaman
  • 164,888
  • 24
  • 203
  • 252
0

Just an update for the benefit of anyone stumbling across this answer... Geobytes has now released a new API to replace the one referred to in a previous answer. The new API is called like this where x.x.x.x is the IP Address:

http://getcitydetails.geobytes.com/GetCityDetails?fqcn=x.x.x.x

There is more info here: http://www.geobytes.com/get-city-details-api/

Better still, it might be easier to use our GeoDirection service - http://www.geobytes.com/geodirection/

herzo
  • 11
  • 1