<VirtualHost *:80>
DocumentRoot "D:\wamp\www\test"
ServerName www.test.cn
DirectoryIndex index.php
<Directory />
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
打开浏览器输入地址跳转不到页面,还得再次输入www后的内容,
解决办法:
D:\wamp\bin\apache\apache2.4.9\conf(这里安装在D盘所以是D)
目录中文件:httpd.conf
找到这一行
#Include conf/extra/httpd-vhosts.conf
去掉最前面的#(这样httpd-vhosts.conf文件才能生效)