Order deny,allow
allow from all
deny from IP
#全部都可以通行
Order deny,allow
deny from IP
allow from all
#全部都可以通行
Order allow,deny
deny from IP
allow from all
#只有IP不能通行
Order allow,deny
allow from all
deny from IP
#只有IP不能通行

Order allow,deny
deny from all
allow from IP
#全部都不能通行
Order allow,deny
allow from IP
deny from all
#全部都不能通行
Order deny,allow
allow from IP
deny from all
#只允许IP通行
Order deny,allow
deny from all
allow from IP
#只允许IP通行
——————————–
Order deny,allow
#全部都可以通行(默认的)
Order allow,deny
#全部都不能通行(默认的)
Order allow,deny
deny from all
#全部都不能通行
Order deny,allow
deny from all
#全部都不能通行
对于上面两种情况,如果换成allow from all,则全部都可以通行!
Order deny,allow
deny from IP
#只有IP不能通行
Order allow,deny
deny from IP
#全部都不能通行
Order allow,deny
allow from IP
#只允许IP通行
Order deny,allow
allow from IP
#全部都可以通行
order deny,allow
allow from 218.20.253.2
deny from 218.20
#代表拒绝218.20开头的IP,但允许218.20.253.2通过;而其它非218开头的IP也都允许通过。
order allow,deny
allow from 218.20.253.2
deny from 218.20

以上代码和注释来源:http://www.2cto.com/Article/201108/98618.html

Related Posts: .htaccess限制IP访问 :