How can I detect visitor's country and redirect he/she to an specific website?

前端 未结 1 1807
死守一世寂寞
死守一世寂寞 2021-01-17 08:00

I have read several answers and I still don\'t know how to do it. I need to redirect my visitors to an specific website depending on their country.I have some knowledge in

相关标签:
1条回答
  • 2021-01-17 08:21

    several ways to do this:

    1. use GPS tag in HTML
      • requires permission from users - probably not widespread.
      • this is the most accurate
    2. using IP address of the browser
      • most people use this and you get IP to Country mapping
      • http://www.codeproject.com/KB/aspnet/aspxcode_net.aspx
      • not as accurate since browser can use proxy
    3. using locale settings (eg. en-US, en-UK etc)
      • cheapest
      • not real location but 90% of users will set correctly.
    0 讨论(0)
提交回复
热议问题