Uncommenting the following line in C:\xampp\apache\conf\httpd.conf
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
*Note:
- Apache should be running on the default port 80
- Avoid the
.dev
extension.
C:\xampp\apache\conf\extra\httpd-vhosts.conf
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/espire.local"
ServerName espire.local
ErrorLog "logs/espire.local-error.log"
CustomLog "logs/espire.local-access.log" combined
<Directory "C:/xampp/htdocs/espire.local">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/cis.local/public"
ServerName cis.local
ErrorLog "logs/cis.local-error.log"
CustomLog "logs/cis.local-access.log" combined
<Directory "C:/xampp/htdocs/cis.local/public">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/api.cis.local/public"
ServerName api.cis.local
ErrorLog "logs/api.cis.local-error.log"
CustomLog "logs/api.cis.local-access.log" combined
<Directory "C:/xampp/htdocs/api.cis.local/public">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
* Note:
- File has to be edited with Administrator rights. Open Note as admin, then Ctrl+O the file
C:\Windows\System32\drivers\etc\hosts
127.0.0.1 cis.local
127.0.0.1 espire.local
127.0.0.1 api.cis.local
Restart Apache Web Server
From the XAMPP Control Panel
Test
Source:
https://ultimatefosters.com/hosting/setup-a-virtual-host-in-windows-with-xampp-server