 
          
How to configure multiple sites on one XAMPP htdocs and edit your hosts file
Changing the Hosts File
Click start search for notepad. Right click and run as administrator. Click open, in the search bar at the top pastec:\windows\system32\drivers\etc\hosts127.0.0.1 nameofyoursite.testVirtual Hosts
OpenC:\xampp\apache\conf\extra\httpd-vhosts.confNameVirtualHosts *:80<VirtualHost *:80>
DocumentRoot "C:\XAMPP\htdocs"
ServerName localhost
</VirtualHost>
//When you load the site if you get directory listings then remove this virtual host.<VirtualHost *:80>
 DocumentRoot "C:\XAMPP\htdocs\nameofyoursite"
 ServerName www.nameofyoursite.test
 <Directory "C:\XAMPP\htdocs\nameofyoursite">
 Options Indexes FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
</Directory>
</VirtualHost>Checks
In cmd navigate toC:\xampp\apache\bin 
//then run
httpd.exe -t
//Should return
Syntax OKTest
In your browser go to www.nameofyoursite.test and you should have your website. Repeat for multiple sites.Notes
If you recieve "Your connection is not private" then it may be because you are using .dev, change to .test to get it to work.Categories: Posts
 
             
                                