问题描述
网站地址指向了一个目录,网站将文件列表返回了,如下图
原因
Indexes
If a URL which maps to a directory is requested and there is no DirectoryIndex (e.g., index.html) in that directory, then mod_autoindex will return a formatted listing of the directory.
Options中配置了Indexes, 如果配置了此项,则访问时,如果当前目录中没有index.html或index.php之类的文件,就会将文件及文件夹列表返回。
参看:https://httpd.apache.org/docs/2.4/mod/core.html#options
解决方案
修改httpd.conf文件,去除Options中的Indexes,如下图
参看
https://httpd.apache.org/docs/2.4/mod/core.html#options