The first step is to open the httpd-vhosts.conf under the Apache/conf/extra folderin the second step, add the following code<virtualhost *:80> ServerAdmin myself.plug.com documentroot "D:\workspace\cbec-v2\amin\web" # #
fill in the local YII2 project directoryServerName cbec.product.com # #
set the virtual host name<directory "D:/workspace/cbec-v2/amin/web" > # #
fill in the local YII2 project directory (note forward slash)Options Indexes followsymlinks allowoverride all Order allow,deny to all </directory></virtua Lhost>step three, modify the Hosts file in the C:\Windows\System32\drivers\etc directory
Note: You must use Administrator privileges to modifyStep: 1, enter Notepad in the Windows Search file box, the corresponding Notepad.exe2 will appear. Right-run 3 as Administrator, select File in Notepad/Open 4, select all files in the bottom right corner, select hosts, open 5, add the following : 127.0.0.1 Virtual Host Name
Configuring a virtual host under Windows