- 修改C:/Windows/System32/drivers/etc/hosts
- 修改/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(你没有权限访问),所以要修改
将denied改为granted - 重启,在浏览器中输入配置好的域名,你就可以通过域名访问本地的项目路径了
转载于:https://my.oschina.net/u/2401265/blog/688678