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 paste
Under the comments add nameofyoursite.test

Virtual Hosts

Uncomment the below line to enable name based virtual hosts on your XAMPP.
NameVirtualHosts *:80
At the end of the file add:
<VirtualHost *:80>
DocumentRoot "C:\XAMPP\htdocs"
ServerName localhost
//When you load the site if you get directory listings then remove this virtual host.
For each site you want to have then add:
<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


In cmd navigate to
//then run
httpd.exe -t
//Should return
Syntax OK


In your browser go to www.nameofyoursite.test and you should have your website. Repeat for multiple sites.


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.