Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have very simple HTML website with a button which takes you a specific book link on amazon.com. But I would now like to make the link a bit more sophisticated - if the visitor is from the UK, I would like the button to take them to the same book on amazon.co.uk. Is there a simple way to do this?

share|improve this question
So what is your question? – John Conde Jul 27 '11 at 13:46
Ok, ok, question edited. – Mick Jul 27 '11 at 14:30

What you want is geolocation by IP address. This can be done on your server, but if you're using just HTML then you'll need to do it on the browser. So if you look for "IP geolocation javascript" then that will give you some companies that provide it.

If you don't want to pay any money then there are free services, but you have to ask yourself if they are reliable.

Sometimes these services get it wrong, so you may want to build in an override so someone can say "actually I am in the UK even though you think I'm not".

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.