apache 2.4版本默认不显示站点目录,虚拟主机配置如下:
<VirtualHost *:80> ServerAdmin 467056016@qq.com DocumentRoot "E:wamp64wwwmy-site est-php" ServerName fuwuqijia.com ErrorLog "logs/fuwuqijia.com-error.log" CustomLog "logs/fuwuqijia.com-access.log" common </VirtualHost>
加入显示站点目录的指令 Options +Indexes,完整代码如下:
<VirtualHost *:80> <Directory "E:wamp64wwwmy-site est-php"> Options +Indexes # 显示站点目录 </Directory> ServerAdmin 467056016@qq.com DocumentRoot "E:wamp64wwwmy-site est-php" ServerName www.fuwuqijia.com ErrorLog "logs/fuwuqijia.com-error.log" CustomLog "logs/fuwuqijia.com-access.log" common </VirtualHost>
Options +Indexes 或 Options Indexes 或没有这条指令,显示站点目录。
Options -Indexes,禁止显示站点目录。