设置应用的本地虚拟域名配置
效果:可在浏览器中通过 fafa.test 访问应用
- 应用可以放在任何地方,不一定要放在apache下
- 找到\xampp\apache\conf\extra\httpd-vhosts.conf,输入
NameVirtualHost *:80
<VirtualHost *:80>
ServerName fafa.test
DocumentRoot "D:/wamp64/www/blog/public/index.php"
</VirtualHost>
- 打开C盘,按路径C:\Windows\System32\drivers\etc找到hosts文件,在最下面添加:
127.0.0.1 fafa.test
- 重启apache
- 完成