如何检测访客的国家/地区并将他/她重定向到特定网站? [英] How can I detect visitor's country and redirect he/she to an specific website?

查看:94
本文介绍了如何检测访客的国家/地区并将他/她重定向到特定网站?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经阅读了几个答案,但我仍然不知道该怎么做。我需要将访问者重定向到特定网站,具体取决于他们的国家。我对html和基本javascript有一些了解。



有人可以粘贴代码吗?

解决方案

有几种方法可以做到这一点:


  1. 在HTML中使用GPS标签


    • 需要用户许可 - 可能不会普及。

    • 这是最准确的
    • 使用浏览器的IP地址


    • 使用区域设置(例如en-US,en-UK等)


      • 最便宜

      • 不是真实的位置,但90%的用户都会正确设置。



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 html and basic javascript.

Could somebody paste the code they?

解决方案

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
  3. using locale settings (eg. en-US, en-UK etc)
    • cheapest
    • not real location but 90% of users will set correctly.

这篇关于如何检测访客的国家/地区并将他/她重定向到特定网站?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆