把里面的内容清空掉,换成下面的内容:
NameVirtualHost *:80
<VirtualHost *:80> ServerName www.host1.com ServerAlias www.host1.com DocumentRoot "D:/wamp/www/host1" </VirtualHost> <VirtualHost *:80> ServerName www.host2.com ServerAlias www.host2.com DocumentRoot "D:/wamp/www/host2" </VirtualHost>3 编辑httpd.conf,找到DocumentRoot "d:/wamp/www/"这项,这是默认根目录路径,但是要更改的不是这个,一直往下找,找到<Directory "d:/wamp/www">,然后在该</Directoory>后加上如下内容:
<Directory "d:/wamp/www/host1">
Options Indexes FollowSymLinks
AllowOverride all Order Allow,Deny Allow from all </Directory> <Directory "d:/wamp/www/host2"> Options Indexes FollowSymLinks AllowOverride all Order Allow,Deny Allow from all </Directory> 4 修改C:/WINDOWS/system3/drivers/etc/host这个文件,用记事本打开,加上如