查文档可知,在配置文件httpd.conf中可限制某些IP访问某个WEB目录,但只限定某一文件行不行呢?
做测试如下:
在httpd.conf中加入,
Order Deny,Allow
allow from 10.0.0.0/255.255.255.0 10.0.107.0/255.255.255.0
deny from all
重启WEB,在浏览器测试:
显示如下:
Forbidden
You don't have permission to access /index2.php on this server.
Apache/2.0.59 (Unix) PHP/4.4.4 mod_jk/1.2.23 Server at 10.0.0.61 Port 80
看来可行。
阅读(1317) | 评论(1) | 转发(0) |