【发布时间】:2017-06-04 04:53:40
【问题描述】:
在我的网站上,我有一个 /upload 目录。而且我不希望人们看到目录中的内容列表(其中的文件仍然可以查看) - 所以对我来说以下错误消息不是错误。
有没有办法禁用以下错误消息,同时保持 /upload 目录列表被禁用/禁止?
[autoindex:error] [pid 17883] [client IP:16603] AH01276: Cannot serve directory /var/www/my-site.com/upload/: No matching DirectoryIndex (index.html,index.cgi,index.pl,index.php,index.xhtml,index.htm) found, and server-generated directory index forbidden by Options directive
我不希望它出现在我的 error.log 中,因为我不认为这是一个错误。
我想我可以在目录中创建自己的“禁止”index.html 文件,但这个问题是针对多个文件夹的,所以我宁愿不这样做(如果可能的话)。
【问题讨论】:
标签: apache2 apache2.4 directory-listing