Here are the two steps for creating multiple virtual hosts in Windows 10 with XAMPP.
Step 1: Open the file httpd-vhosts.conf in a code editor (could be open in notepad as well).
File location: DriveName:\xampp\apache\conf\extra.
Now copy and paste the below code at bottom of the config file-
ServerAdmin [email protected]
Allow from All
Save the file and close it if you want else you can close later.
Step 2: Open the windows virtual host file named as hosts.
The file can be found at location C:\Windows\System32\drivers\etc\
Also you can use win+r/R to open the file directly.
There you will see “127.0.0.1 localhost” is added already. Leave it as it is.
In next line write ” 127.0.0.1 testvirtual.local”
Save the file and restart XAMPP’s apache server. You’ll see your virtual host running.