DocumentRoot "D:\wamp\www"
ServerName a.com
DocumentRoot "D:\wamp\www\yiqu"
ServerName b.com
写了
hosts
127.0.0.1 a.com
127.0.0.1 b.com
为什么访问 a.com还是打不开
回复讨论(解决方案)
httpd.conf 中的 Include conf/extra/httpd-vhosts.conf 去掉注释了吗?
httpd-vhosts.conf文件
DocumentRoot "D:\wamp\www"
ServerName a.com
DocumentRoot "D:\wamp\www\yiqu"
ServerName b.com
写了
hosts
127.0.0.1 a.com
127.0.0.1 b.com
为什么访问 a.com还是打不开
直接写在apache的httpd.conf
或者写在httpd-vhosts.conf,但是要注释掉httpd.conf里面加载httpd-vhosts.conf的#号
httpd-vhosts.conf文件
DocumentRoot "D:\wamp\www"
ServerName a.com
DocumentRoot "D:\wamp\www\yiqu"
ServerName b.com
写了
hosts
127.0.0.1 a.com
127.0.0.1 b.com
为什么访问 a.com还是打不开
直接写在apache的httpd.conf
或者写在httpd-vhosts.conf,但是要注释掉httpd.conf里面加载httpd-vhosts.conf的#号 或者写在httpd-vhosts.conf,但是要注释掉httpd.conf里面加载httpd-vhosts.conf的#号 我是这样做的哈
在httpd.conf中的还有几处AllowOverride None需要改成AllowOverride All