Beispiel für Datei „C:\xampp\apache\conf\extra\httpd-vhosts.conf“
# VirtualHost localhost
<VirtualHost 127.0.0.1>
DocumentRoot "C:\xampp\htdocs"
ServerName localhost
</VirtualHost>
# VirtualHost Projekt 1
<VirtualHost 127.0.0.1>
DocumentRoot "C:\xampp\htdocs\projectname1"
ServerName project1.localhost
</VirtualHost>
# VirtualHost Projekt 2
<VirtualHost 127.0.0.1>
DocumentRoot "C:\xampp\htdocs\projectname2"
ServerName pbroject2.localhost
</VirtualHost>
Beispiel für Datei „C:\Windows\System32\drivers\etc\hosts“ (als „Administrator“ öffnen)
Jetzt müssen die virtuellen hosts noch für Windows bekannt gemacht werden:
127.0.0.1 localhost 127.0.0.1 project1.localhost 127.0.0.1 project2.localhost