htaccess允许国家域名

时间:2012-07-16 07:57:08

标签: .htaccess dns block country

我想阻止除文莱之外的所有国家。域名是.bn

<Limit GET POST PUT>
order deny,allow
deny from all
allow from .bn
allow from *.bn
allow from *.*.bn
allow from *.*.*.bn
</Limit>

我的姓名地址:smp-85-139.simpur.net.bn所以我相信下面的代码有效:

allow from *.*.*.bn

但我仍然禁止访问。这里有什么遗漏?


我尝试使用IP但仍然阻止了..

<Limit GET POST PUT>
order deny,allow
deny from all
allow from 202.152.*.*
</Limit>

我的IP是202.152.85.139


更新: 我的网络主机似乎正在使用nginx,所以如果我正确的话,这个设置根本不会起作用。

1 个答案:

答案 0 :(得分:1)

以下是文莱达鲁萨兰国的.htaccess允许列表,由Country IP Blocks提供。截至2013年4月20日,数据正确无误。

如果您的托管公司允许您使用.htaccess,您可以将以下数据复制并粘贴到.htaccess文件中并将其加载到您的根目录中:

<Limit GET POST>
order deny,allow
allow from 61.6.192.0/18
allow from 103.4.188.0/22
allow from 103.12.208.0/23
allow from 103.16.120.0/22
allow from 103.17.24.0/22
allow from 103.18.172.0/22
allow from 103.20.24.0/22
allow from 118.103.248.0/21
allow from 119.160.128.0/18
allow from 156.31.0.0/16
allow from 158.161.0.0/16
allow from 192.94.122.0/24
allow from 202.12.26.0/24
allow from 202.59.230.0/24
allow from 202.90.36.0/24
allow from 202.93.208.0/20
allow from 202.152.64.0/19
allow from 202.160.0.0/19
allow from 202.160.32.0/20
deny from all
</Limit>