Windows System Configuration:
Modify the file C:/Windows/system32/Drivers/etc/hosts
(If you do not have the permission to modify it, perform the following configuration: Right-click Properties-> Security-> select your permission user edit-> hide full control-> application-> okay)
Add at the end of the file:
127.0.0.1 www.sina.com
Here www.sina.com is the domain name of the virtual host I set.
Apache Server Configuration:
Enable rewrite module:
Loadmodule rewrite_module modules/mod_rewrite.so
Load the VM configuration file:
# Virtual Hosts
Include CONF/extra/httpd-vhosts.conf
Apache Virtual Host file Configuration:
Open and edit the file according to the path of the virtual host configuration file in the Apache Server Configuration:
Set the virtual host, set the document root path, and set the server name and the virtual host name in windows to be consistent:
<Virtualhost *: 80>
DocumentRoot "D:/Wamp/mysina"
Servername www.sina.com
</Virtualhost>
Restart Apche.