yii2 apache配置虚拟域名

182 阅读1分钟

第一:xampp软件中,F:\6\apache\conf\extra\httpd-vhosts.conf文件中(复制粘贴):

<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host2.example.com
    DocumentRoot "F:/6/htdocs/advanced/frontend/web"
    ServerName www.yii2.com;
    ErrorLog "logs/dummy-host2.example.com-error.log"
    CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>

在这里插入图片描述
第二:C:\Windows\System32\drivers\etc\hosts文件中。复制粘贴即可.

127.0.0.1   www.yii2.com

在这里插入图片描述