WAMP2.5虛擬域名配置
- 修改C:/Windows/System32/drivers/etc/hosts
![](http://static.javashuo.com/static/loading.gif)
- 修改/wamp/bin/apache/apache2.4.9/conf/httpd.conf
去掉LoadModule rewrite_module modules/mod_rewrite.so、Include conf/extra/httpd-vhosts.conf前面的註釋
- 修改/wamp/bin/apache/apache2.4.9/conf/extra/httpd-vhosts.conf
<VirtualHost *:80>
DocumentRoot "E:/www.baidu.com"
ServerName www.baidu.com
ServerAlias www.baidu.com
<Directory "E:/www.baidu.com">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog "logs/dummy-host2.example.com-error.log"
CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>
將原來的刪掉或者是註釋掉
- 這時訪問設置的域名會報403(你沒有權限訪問),因此要修改
![](http://static.javashuo.com/static/loading.gif)
將denied改成granted
- 重啓,在瀏覽器中輸入配置好的域名,你就能夠經過域名訪問本地的項目路徑了
歡迎關注本站公眾號,獲取更多信息