Home > Article > Backend Development > How to Create Virtual Hosts on XAMPP?
Creating Virtual Hosts on XAMPP
To create virtual hosts on XAMPP, follow these steps:
1. Update Hosts File
Add the following entries:
127.0.0.1 localhost 127.0.0.1 [Host Domain Name]
2. Configure Virtual Host
Open xamppapacheconfextrahttpd-vhosts.conf and add the following block:
<VirtualHost *:80> DocumentRoot "C:/xampp/htdocs/[Host Domain Path]" ServerName [Host Domain Name] </VirtualHost>
3. Uncomment Virtual Host Module
In xamppapacheconfhttpd.conf, scroll to the Supplemental configuration section and uncomment the following line:
#Virtual hosts Include conf/extra/httpd-vhosts.conf
4. Restart XAMPP and Access Virtual Host
Restart XAMPP and access the virtual host in your browser by entering the Host Domain Name as the website address.
The above is the detailed content of How to Create Virtual Hosts on XAMPP?. For more information, please follow other related articles on the PHP Chinese website!