yii2 apache配置虚拟域名

2021-12-23 15:13:10 浏览数 (1)

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

代码语言:javascript复制
<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:WindowsSystem32driversetchosts文件中。复制粘贴即可.

代码语言:javascript复制
127.0.0.1   www.yii2.com

0 人点赞