還可以配置多域名多目錄。屏蔽網站廣告~~
1.找到wamp安裝目錄的apache安裝目錄 找到 httpd.conf文件 例如我安裝的目錄爲C:\wamp\bin\apache\Apache2.2.21\conf\httpd.conf
也可以通過wamp圖標打開。查找 Virtual hosts 去掉下面include行前面的## Virtual hosts
Include conf/extra/httpd-vhosts.conf
2.這樣就包含了C:\wamp\bin\apache\Apache2.2.21\conf\extra\httpd-vhosts.conf文件
在後面添加
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot "D:/www/thinkphpTest"
ServerName www.jiayou.com
ServerAlias www.jiayou.com
ErrorLog "logs/ www.jiayou.com -errlo.log"
CustomLog "logs/ www.jiayou.com -access.log" common
<directory "D:/www/thinkphpTest">
Options FollowSymLinks
AllowOverride all
Order Deny,Allow
Deny from all
Allow from all
</directory>
</VirtualHost>
其中 ServerAdmin、ErrorLog 、CustomLog爲可選配置,也可以不對其進行配置。
3.C:\Windows\System32\drivers\etc\hosts中後面添加
#2015-12-5 15:06:52 測試多域名
127.0.0.1 www.jiayou.com
這裏可以對各種站點進行屏蔽。
4.重啓apache服務。就ok了。