wamp配置两个虚拟主机后,访问不正常
wamp配置多个虚拟主机后,访问不正常
配置如下:
<VirtualHost *:80>
# ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "D:\wwwroot\nasdao"
ServerName www.a.com
# ServerAlias www.dummy-host.example.com
# ErrorLog "logs/dummy-host.example.com-error.log"
# CustomLog "logs/dummy-host.example.com-access.log" common
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "D:\wwwroot\jyd\web"
ServerName www.b.com
ServerAlias www.b.com
ErrorLog "D:\wwwroot\jyd\error.log"
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "D:\wwwroot\jyd\web"
ServerName b.com
ServerAlias b.com
ErrorLog "D:\wwwroot\jyd\error.log"
</VirtualHost>
在访问www.b.com 和去掉www直接访问b.com时候访问特别缓慢 访问www.a.com正常
[解决办法]
试试:
<VirtualHost *:80>
DocumentRoot "D:\wwwroot\jyd\web"
ServerName www.b.com
ServerAlias b.com
ErrorLog "D:\wwwroot\jyd\web\error.log"
</VirtualHost>