1、进入apache的配置文件 httpd.conf 找到:
<Directory "C:/xampp/htdocs">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks Includes ExecCGI
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# AllowOverride FileInfo AuthConfig Limit
#
AllowOverride All
#
# Controls who can get stuff from this server.
#
Require all granted
</Directory>
2、修改
把 Options Indexes FollowSymLinks Includes ExecCGI那行,改成
#Options Indexes FollowSymLinks Includes ExecCGI
Options FollowSymLinks Includes ExecCGI
就是将Indexes去掉,Indexes表示若当前目录没有index.html就会显示目录结构。
重启Apache服务器
3、修改前
