Virtual Host let you run multiple Websites on your computer.
It also lets you store the files for those sites anywhere on your computer and not just in the C:XAMPP/htdocs folder.
- It tells the computer to NOT go out on the internet when you type a particular URL like http://projectA/ but instead look for that particular domain on your own computer.
- Add the below line at the end of file hosts which is located at C:windows/system32/drivers/etc
- This is how a computer refers to itself, it’s an IP address that points back to the computer, kind of like a computer’s way of saying “ME”.
- The second part (projectA) is the “domain” of the virtual host.
- It tells Apache where the files for the site are located on your computer.
- Add the below codes at the end of file httpd-vhosts.conf located at C:xampp/apache/conf/extra
Restart apache and http://projectA/ will be accessible from a web browser.