views:

20

answers:

1

Hi,

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!

+1  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.

Dan Grossman
The URL to access your site in this example would be: http:// mycustomname You can also use a dotted name such as yoursite.localhost in place of mycustomname.
orvado