从我所能读的改变
Options All Indexes FollowSymLinks MultiViews
至
Options All FollowSymLinks MultiViews
在httpd.conf
应该禁用目录列表,但是我仍然可以列出它们。
我只能使用.htaccess
文件禁用此function。
题
如何禁用DocumentRoot
和所有VirtualHost
的httpd.conf
目录列表?
不,它不能这样工作, All
意味着启用除MultiViews
之外的所有选项,顺序也很重要。 要禁用您需要的目录列表 – -Indexes
如此
Options All FollowSymLinks MultiViews -Indexes
会工作,但是
Options -Indexes All FollowSymLinks MultiViews
不会像-Indexes
之后的All
重新启用它。
你应该把它放在你的httpd.conf中来全局地禁用索引:
Options -Indexes
然后,你应该检查所有的虚拟主机,看看他们是否明确启用。
这个博客文章可能有助于理解目录列表如何工作。
从标志中删除All
。 除MultiViews
以外, All
设置都启用。