Map a local domain using apache httpd.conf and windows hosts file

Posted by & filed under Windows webserver.

Add a host file definition, eg:

mydomain.dev 127.0.0.1

This tells your PC to send that domain to localhost. Now in apache’s httpd.conf you set up a virtual host to map that domain on localhost to a ‘DocumentRoot’ directory on your machine:

<VirtualHost 127.0.0.1> 
ServerName mydomain.dev
DocumentRoot "C:\xampp\htdocs\mydomain"
</VirtualHost>

Leave a Reply

  • (will not be published)

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Bitnami