Q:

VirtualHost on XAMPP

I'm using XAMPP lite on Windows 7, but instead of http://localhost I'd like to have http://mycustomname mapped to a directory myfolder in root/htdocs. 
What should I change in httpd.conf?
Many thanks!

A:

Add to your xampp\apache\conf\extra\httpd-vhosts.conf file:
NameVirtualHost *:80
<VirtualHost *:80>
    ServerName mycustomname
    ServerAlias mycustomname
    DocumentRoot "c:\xampp\htdocs\myfolder"
</VirtualHost>

Now edit c:\windows\system32\drivers\etc\hosts and add a new line:
127.0.0.1        mycustomname

Which will cause Windows to resolve your custom name to 127.0.0.1. Restart Apache and you can access your site.

