1. Install the XAMPP installation package to D, after the installation is complete, exit the XAMPP integration environment, go to the next step, configure the virtual host; first create a new directory Magento2 and Test folder in the Xampp/htdocs directory (this folder is the entire contents of your project).
PS. When creating multiple virtual hosts, you also need to create a new folder containing all of your items, such as Magento2 and test, if you need to create the folder again.
2. Locate your XAMPP installation directory, open the following directory: Apache/conf/extra directory Locate the httpd-vhosts.conf file, and then open it in Notepad.
3. After opening http-vhosts.conf, add the following code at the bottom:
ServerName www.magento2.com DocumentRoot "D:/XAMPP/htdocs/magento2"
Options FollowSymLinks IncludesNOEXEC Indexes DirectoryIndex index.html index.htm index.php AllowOverride all Order Deny,Allow Allow from all Require all granted
ServerName www.test.com DocumentRoot "D:/XAMPP/htdocs/test"
Options FollowSymLinks IncludesNOEXEC Indexes DirectoryIndex index.html index.htm index.php AllowOverride all Order Deny,Allow Allow from all Require all granted
4. In addition, you need to configure the C-drive host file, find the following directory: C-Disk/windows/system32/drivers/etc directory, find the Hosts file, open with Notepad, add 127.0.0.1 www.magento2.com Save, Such as:
127.0.0.1 www.magento2.com127.0.0.1 www.test.com
5. Configure the virtual host to complete, restart the XAMPP integration environment.
The above describes the XAMPP configuration virtual host specific steps, including the aspects of the content, I hope the PHP tutorial interested in a friend helpful.