1. 編輯 httpd.conf,查找 Include conf/extra/httpd-vhosts.conf,把前面注釋符號“#”刪掉。
2. 找到安裝目錄下 wamp\bin\apache\Apache2.2.17\conf\extra 下 httpd-vhosts.conf 這個文件
3. 把裡面的内容清空掉.舉例換成下面的內容
QUOTE:
NameVirtualHost *:804.然後重啟apache,在瀏覽器裡面輸入www.aaa.com.tw 跟 www.bbb.com.tw ,看看設定正不正常囉~~
<VirtualHost *:80>
ServerName www.aaa.com.tw
DocumentRoot D:/htdocs/dz
DirectoryIndex index.php index.html index.htm
<Directory "D:/htdocs/dz">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName www.bbb.com.tw
DocumentRoot D:/htdocs/dz2
DirectoryIndex index.php index.html index.htm
<Directory "D:/htdocs/dz2">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>