修改httpd.conf打开列目录功能:
<Directory /path/to/directory>
Options +Indexes
</Directory>
关闭列目录功能:
<Directory /path/to/directory>
Options -Indexes
</Directory>
<Directory /path/to/directory>
Options +Indexes
</Directory>
关闭列目录功能:
<Directory /path/to/directory>
Options -Indexes
</Directory>
重启apache 即可
====
附:
Options 指令:
1) ExecCGI CGI 脚本程序能够运行于该目录树。
2) FollowSymLinks 在该目录中,服务器将跟踪符号链接。注意:即使服务器跟踪符号链接,它也不会改变用来匹配不同区域的路径名。注意:如果在区域内设置,该选项会被忽略。
3) Includes 服务器端包容被允许。
4) IncludesNOEXEC 服务器端引用被允许,但 #exec 命令和 CGI 脚本程序的 #include 被禁止。
5) Indexes 如果要求映射到目录的 URL 和在该目录里没有 DirectoryIndex(例如,index.html),那么服务器将返回格式化的目录列表。
6) MultiViews 处理多重浏览内容被允许。
7) SymLinksIfOwnerMatch 通过与用户 id 一样的链接,服务器只跟踪目标文件或者目录所拥有的符号链接。
8) All 除 MultiViews 外的一切东西。要是没有 Options 指令,默认为all.