在httpd-vhosts.conf 里面添加
<VirtualHost 127.0.0.1:80>
DocumentRoot "E:\xampp\htdocs\hunanwan" ServerName hn.wan.com</VirtualHost><VirtualHost 127.0.0.2:80> DocumentRoot "E:\xampp\htdocs\yii\demo" ServerName yii.demo.com</VirtualHost>
然后在C:\Windows\System32\drivers\etc\hosts 中添加
127.0.0.1 hn.wan.com
127.0.0.2 yii.demo.com重启apache服务 访问hn.wan.com ,yii.demo.com