限制网站访问特定的国家/地区 [英] Restrict website to access specific country

查看:161
本文介绍了限制网站访问特定的国家/地区的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想知道是否有可能让我的网站只适用于特定的国家/地区。
因此,任何试图访问特定国家/地区以外的网站的用户都无法访问。



我正在考虑获取一个php IP地理定位器脚本,并执行如果他们的IP地址是来自我决定的国家的话,那么它会被重定向。

你们如何推荐它?

谢谢。



编辑



不必100%准确。只需要PHP代码,将做我所需要的。
该国是罗马尼亚。谢谢! :)

解决方案

答案取决于您所指的可用于特定国家/地区。


  1. 如果国内电脑的IP地址不在您的列表中,该怎么办?该计算机无法访问,但它位于国家/地区。 如果国外的计算机在您的列表中有IP地址,该怎么办?该计算机将具有地址,但它不在国家/地区。

  2. 如果具有国内IP地址的路由器转发来自国外的请求会怎么样?如果国内路由器是 TOR网络的一部分,那该怎么办?


  3. 如果一位公民离开该国并希望从另一个国家访问您的国内网站,该怎么办?公民将拥有一个IP地址而不是您的名单,并将被拒绝访问。

  4. 具体的国家你的问题无法得到解答。


    I am wondering if it's possible to make my website only available to a specific country. So anyone who tries to visit the website outside the specific country, will not have access.

    I was thinking of getting a php IP Geo Locator script and do a redirect if they IP address is from the country I decide.

    How would you guys recommend it?

    Thank you.

    EDIT

    This doesn't have to be 100% accurate. Just need the php code that will do what I need. The country is Romania by the way. Thanks! :)

    解决方案

    The answer depends on what you mean by "available to a specific country".

    1. What if an in-country computer has an IP address not on your list? That computer won't have access, but it's located in country.

    2. What if an out-of-country computer has an IP address on your list? That computer will have address, but it's not located in country.

    3. What if a router with an in-country IP address forwards requests from out-of-country? What if an in-country router is part of the TOR network?

    4. What if a citizen leaves the country and wants to get access to your in-country web site from another country? The citizen will have an IP address not your list and will be denied access.

    Until you define "available to a specific country" your question cannot be answered.

    这篇关于限制网站访问特定的国家/地区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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