如何禁用目录列表?

San*_*dra 4 linux apache-2.2

从我能读到的变化

Options All Indexes FollowSymLinks MultiViews 
Run Code Online (Sandbox Code Playgroud)

Options All FollowSymLinks MultiViews
Run Code Online (Sandbox Code Playgroud)

inhttpd.conf应该禁用目录列表,但我仍然可以列出它们。

我只能使用.htaccess文件禁用此功能。

如何禁用httpd.confforDocumentRoot和 all 中VirtualHost的目录列表?

use*_*517 7

不,它不是那样工作的,这All意味着启用所有选项,除了MultiViews,顺序也很重要。要禁用目录列表,你需要-Indexes这样

Options All FollowSymLinks MultiViews -Indexes 
Run Code Online (Sandbox Code Playgroud)

会工作,但

Options -Indexes All FollowSymLinks MultiViews
Run Code Online (Sandbox Code Playgroud)

不会因为All之后-Indexes会重新启用它。