Here i am going to give you step by step instructions to setup virtual hosts using XAMPP on windows machine.
As we know wordpress is widely used to create multisite and it’s very easy to create multisite using wordpress.
Virtual hosts is very useful to run wordpress multisite in your localhost server.
Follow below steps to setup virtual hosts
1.First you need to install XAMPP, you can download it from here Click here to download XAMPP.
2.Go to your XAMPP installed directory and then navigate here C:/xampp/apache/conf/extra , as my XAMPP installed in C: drive .May be it’s your different drive.
3.Open this file httpd-vhosts.conf.
4.Uncomment this line # NameVirtualHost *:80 by removing hash.
5.After that add below code:
6.Then you need to setup your project directory and server name for your project, add below code for this and save it:
DocumentRoot "C:/xampp/htdocs/mysite" //this is your project directory
Allow from all
7.Now you need to edit your windows hosts file for this navigate here: C:/Windows/System32/drivers/etc/hosts.
Then find this line
Then point your site like this:
Now save your hosts file.
Now you finished your setup , restart your XAMPP apache server.
Open browser and access your site like this: mysite.devgang