Skip to content

关闭Apache的目录浏览功能

2009 四月 23
by 荒野无灯

用途:在目录下没有默认首页面(如index.html index.php)时防止用户浏览web目录。

记得以前没有权利修改Apache配置、服务器也不支持.htaccess文件的时候都是在每个目录下新建index.html来防止列目录的,现在提供2种方法来放置用户列web目录。

1、Apache配置文件修改法

打开Apache配置文件httpd.conf

查找 Options Indexes FollowSymLinks

修改为 Options -Indexes (减号就代表取消)

保存退出,重新启动Apache

2、.htaccess文件修改法

在.htaccess文件里加入以下内容就可以阻止目录列表的显示了。

Options -Indexes

喜欢这篇文章吗?

请订阅本站 RSS feed填写您的邮件地址,订阅我们的精彩内容:,欢迎点击这里捐赠以支持荒野无灯转播到腾讯微博 转播到腾讯微博

作者:荒野无灯
出处:Hacklog【Hacklog】

声明: 本站遵循 署名-非商业性使用-相同方式共享 3.0 共享协议. 转载请注明转自Hacklog【荒野无灯weblog】

本文链接: http://ihacklog.com/?p=1732

One Response Post a comment
  1. 四月 23, 2009

    不错,这样的话我就可以把我的插件目录什么的都给关了。别人看不到鸟。。呵。

Leave a Reply

Allowed Tags - You may use these HTML tags and attributes in your comment.

<a href="" title=""> <abbr title=""> <acronym title=""> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <q cite=""> <strong>

 :wink:  :-|  :-x  :twisted:  :)  8-O  :(  :roll:  :-P  :oops:  :-o  :mrgreen:  :lol:  :idea:  :-D  :evil:  :cry:  8)  :arrow:  :-?  :?:  :!:

Note: You may use basic HTML in your comments. Your email address will not be published.

Subscribe to this comment feed via RSS