<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Bssn.Biz &#187; .htaccess</title>
	<atom:link href="http://www.bssn.biz/tag/htaccess/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bssn.biz</link>
	<description>This is a blog of Bssn.Biz.</description>
	<lastBuildDate>Mon, 01 Feb 2010 16:23:07 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>.htaccess 封禁中国IP</title>
		<link>http://www.bssn.biz/block-chinese-ip-address/</link>
		<comments>http://www.bssn.biz/block-chinese-ip-address/#comments</comments>
		<pubDate>Sat, 17 May 2008 19:32:36 +0000</pubDate>
		<dc:creator>Bssn</dc:creator>
				<category><![CDATA[知识的累积]]></category>
		<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[Allow From]]></category>
		<category><![CDATA[block ip address]]></category>
		<category><![CDATA[China Block List]]></category>
		<category><![CDATA[Deny From]]></category>
		<category><![CDATA[中国IP]]></category>
		<category><![CDATA[中国IP段]]></category>

		<guid isPermaLink="false">http://www.bssn.biz/?p=73</guid>
		<description><![CDATA[首先强调一下这与爱国无关。
出于不同原因，很多站长需要封禁中国ip，特别是做英文站的朋友。因为对于Google AdSense来说，中文ip是低价的代名词。
屏蔽ip段很简单，在.htaccess里加入：
order allow,deny
# 禁止一个ip地址
deny from 123.125.125.147
# 禁止一个ip段
deny from 210.145.95.0/255
# 或者你需要在这ip段中允许部分ip
allow from 210.145.95.123
# 除此之外一切均可以访问
allow from all

了解了.htacess的deny ip用法后，我们只需要有中国ip就能解决问题了。上Google找了一圈发现这个叫做 Stop Traffic From China IP Address Blocks To Protect Your Web Server From Chinese Hackers的文章，其文章已经通过.htaccess对中国ip实行封禁，所以要访问的话得翻墙了（推荐一个在线代理）。这篇文章的初衷在于限制国内ip来防止中国黑客攻击，看来中国黑客还是比较有名的啊，同样有名的还有俄罗斯的，呵呵。
文章给出了.htaccess全文来限制中国及中国周边国家的ip，文中将台湾写成中国的邻国，俺改了一下下:) （中国ip中最后三个ip段为台湾省ip）：

# This blocklist was last updated on Saturday, 17-May-2008 09:43:34 MDT
# 最新更新时间：2008-05-17
order deny,allow
# Chinese IP addresses follow:
# 中国ip地址
deny from 58.22.0.0/15 58.56.0.0/15 58.58.0.0/16 58.59.0.0/17 58.60.0.0/14 [...]]]></description>
			<content:encoded><![CDATA[<p>首先强调一下这与爱国无关。</p>
<p>出于不同原因，很多站长需要封禁中国ip，特别是做英文站的朋友。因为对于Google AdSense来说，中文ip是低价的代名词。</p>
<p>屏蔽ip段很简单，在.htaccess里加入：</p>
<blockquote><p>order allow,deny<br />
# 禁止一个ip地址<br />
deny from 123.125.125.147</p>
<p># 禁止一个ip段<br />
deny from 210.145.95.0/255</p>
<p># 或者你需要在这ip段中允许部分ip<br />
allow from 210.145.95.123</p>
<p># 除此之外一切均可以访问<br />
allow from all
</p></blockquote>
<p>了解了.htacess的deny ip用法后，我们只需要有中国ip就能解决问题了。上Google找了一圈发现这个叫做 <a href="http://www.parkansky.com/china.htm" target=_blank>Stop Traffic From China IP Address Blocks To Protect Your Web Server From Chinese Hackers</a>的文章，其文章已经通过.htaccess对中国ip实行封禁，所以要访问的话得翻墙了（推荐一个<a href="http://www.freedaili.com" target=_blank>在线代理</a>）。这篇文章的初衷在于限制国内ip来防止中国黑客攻击，看来中国黑客还是比较有名的啊，同样有名的还有俄罗斯的，呵呵。</p>
<p>文章给出了.htaccess全文来限制中国及中国周边国家的ip，文中将台湾写成中国的邻国，俺改了一下下:) （中国ip中最后三个ip段为台湾省ip）：</p>
<blockquote><p><Files *></p>
<p># This blocklist was last updated on Saturday, 17-May-2008 09:43:34 MDT<br />
# 最新更新时间：2008-05-17<br />
order deny,allow</p>
<p># Chinese IP addresses follow:<br />
# 中国ip地址<br />
deny from 58.22.0.0/15 58.56.0.0/15 58.58.0.0/16 58.59.0.0/17 58.60.0.0/14 58.82.0.0/15 58.208.0.0/12 58.246.0.0/15 58.248.0.0/13 59.32.0.0/13 59.40.0.0/15 59.42.0.0/16 59.56.0.0/13 60.12.0.0/16 60.28.0.0/15 60.160.0.0/11 60.194.0.0/15 60.208.0.0/13 60.216.0.0/15 61.4.64.0/20 61.48.0.0/13 61.128.0.0/10 61.135.0.0/16 61.145.73.208/28 61.179.0.0/16 61.183.0.0/16 61.184.0.0/16 61.185.219.232/29 61.188.0.0/16 61.232.0.0/14 61.236.0.0/15 118.132.0.0/14 119.18.192.0/20 121.32.0.0/14 123.4.0.0/14 124.42.64.0/18 124.236.0.0/14 125.40.0.0/13 159.226.0.0/16 202.66.0.0/16 202.96.0.0/12 202.96.128.0/18 202.108.0.0/16 203.69.0.0/16 203.169.160.0/19 210.5.0.0/19 210.14.128.0/19 210.21.0.0/16 210.51.0.0/16 210.192.96.0/19 211.76.96.0/20 211.78.208.0/20 211.90.0.0/15 211.136.0.0/13 211.233.70.0/24 211.144.12.0/22 211.144.160.0/20 211.152.14.0/24 211.154.128.0/19 211.157.32.0/19 211.161.24.128/26 218.0.0.0/11 218.56.0.0/13 218.64.0.0/11 218.88.0.0/13 218.96.0.0/14 218.102.0.0/16 218.104.136.128/25 218.242.0.0/16 219.128.0.0/11 219.232.0.0/19 220.160.0.0/11 220.181.0.0/16 220.192.0.0/12 220.228.70.0/24 220.248.0.0/14 220.250.0.0/19 220.252.0.0/16 221.10.0.0/16 221.11.0.0/16 221.192.0.0/14 221.208.0.0/14 221.212.0.0/16 221.216.0.0/13 221.224.0.0/13 221.228.0.0/14 221.238.0.0/15 222.32.0.0/11 222.76.0.0/14 222.80.0.0/12 222.136.0.0/13 222.166.0.0/16 222.168.0.0/15 222.172.222.0/24 222.184.0.0/13</p>
<p># Japan (hacking, scraping, or spamming)<br />
deny from 218.225.179.0/24</p>
<p># Korea IP addresses follow:<br />
# 韩国ip<br />
deny from 58.72.0.0/13 58.239.0.0/16 58.140.0.0/14 59.0.0.0/11 59.86.192.0/18 59.186.0.0/15 61.96.0.0/12 61.248.0.0/13 116.120.0.0/13 118.32.0.0/11 118.128.0.0/14 121.128.0.0/10 122.99.128.0/17 123.111.48.0/20 124.0.0.0/15 124.50.87.161 125.128.0.0/11 125.176.0.0/12 125.240.0.0/13 143.248.0.0/16 202.179.176.0/21 210.93.0.0/16 210.94.0.0/15 210.118.216.192/26 210.205.219.0/24 211.32.0.0/12 211.48.0.0/15 211.104.0.0/13 211.112.0.0/13 211.168.0.0/14 211.172.0.0/14 211.176.0.0/12 211.192.0.0/13 211.211.36.0/23 211.232.0.0/13 211.240.0.0/12 218.38.34.0/24 218.144.138.0/26 218.147.0.0/16 219.240.0.0/15 219.248.0.0/13 219.250.88.0/21 220.73.22.160/27 220.95.88.0/24 221.128.0.0/12 221.144.0.0/12 221.160.0.0/13 221.168.0.0/16 221.163.46.0/24 222.96.0.0/12 222.112.0.0/13 222.120.0.0/15 222.122.0.0/16 59.124.0.0/14 203.71.0.0/16 203.72.0.0/16</p>
<p># Neighboring Asian countries:<br />
# 临近亚洲国家和地区</p>
<p># Malaysia<br />
# 马来群岛<br />
deny from 60.48.0.0/14 60.52.0.0/15 60.54.0.0/16 124.217.224.0/19 202.58.80.0/20 202.71.96.0/20 202.75.32.0/19 203.223.128.0/19 210.187.49.0/25 218.111.0.0/16 218.208.12.64/27</p>
<p># Philippines<br />
# 菲律宾</p>
<p>deny from 85.92.152.0/21 222.127.32.0/19 222.127.64.0/19</p>
<p># Singapore<br />
# 新加坡<br />
deny from 59.189.0.0/16 116.14.0.0/15 165.21.0.0/16 219.74.0.0/16 219.75.0.0/17</p>
<p># Thailand<br />
# 泰国<br />
deny from 58.9.0.0/16 58.137.13.0/24 61.19.64.0/18 117.47.0.0/16 202.28.0.0/15 202.44.135.0/24 203.107.142.0/24 203.113.13.0/24 202.143.128.0/18 203.144.128.0/17 203.148.128.0/17 203.149.0.0/18 203.150.128.0/17 203.151.38.0/24 203.155.0.0/16 203.172.128.0/17 222.123.0.0/16</p>
<p># Vietnam<br />
# 越南<br />
deny from 58.187.112.0/20 125.234.0.0/15 203.113.128.0/18 203.162.0.0/16</p>
<p># End Chinese/Korean blocklist<br />
# 中国/韩国 禁止列表 结束<br />
# Add other blocked domain names or IP addresses here, starting with &#8220;deny from &#8221; without quotes<br />
# 这里添加其他你需要禁用的ip地址或者郁闷，用 &#8220;deny from&#8221; （不包含引号）</p>
<p># If you find that you need to poke a hole in the blocklist, for legitimate visitors, follow this example: allow from 123.456.789.0<br />
# 如果需要添加例外的话，使用 allow from， 例如：allow from 123.456.789.0</p>
<p># Add &#8220;allow from&#8221; IP addresses, or CIDR Ranges, after all of the &#8220;deny from&#8221; items, just before the closing Files tag.<br />
# 在 Files 标签结束前，全部 &#8220;deny from&#8221; 后，添加 &#8220;allow from&#8221; 来增加特例</p>
<p># Everything not included within these deny from ranges is PERMITTED by the allow portion of the directive.<br />
# 本文中没有添加的ip或者ip段即为可以访问ip<br />
</Files></p>
<p># This prevents web browsers or spiders from seeing your .htaccess directives:<br />
# 下面这个用以保护你的.htaccess不被蜘蛛或者网页浏览器获取。<br />
<Files .htaccess><br />
deny from all<br />
</Files></p>
<p># End of file</p></blockquote>
<p>.htaccess翻译自：<a href="http://www.wizcrafts.net/chinese-blocklist.html">http://www.wizcrafts.net/chinese-blocklist.html</a>，记得翻墙（推荐一个<a href="http://www.freedaili.com" target=_blank>在线代理</a>）。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bssn.biz/block-chinese-ip-address/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
