日期:2014-05-17  浏览次数:20885 次

如何防止apache显示文件列表

如何防止apache显示文件列表

1.找到apache配置文件httpd.conf

2.设置
打开列目录功能:
<!--/path/to/directory是指你的apache设置的项目根路径,
如D:/Program Files/Apache Software Foundation/Apache2.2/htdocs-->

<Directory /path/to/directory>
Options +Indexes
</Directory>
关闭列目录功能:
<!--在其中找到Options选项,把Indexes去掉或是前面加上"-"号-->
<Directory /path/to/directory>
Options -Indexes
</Directory>