第一:xampp软件中,F:\6\apache\conf\extra\httpd-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:\Windows\System32\drivers\etc\hosts文件中。复制粘贴即可.
代码语言:javascript
复制
127.0.0.1 www.yii2.com