Apache logo
To configure multiple domains or subdomains in WAMP or XAMP's apache server for Local Development using httpd.conf, httpd-vhosts.conf (Virtualhost config) and host file of windows.
First of all open the  file: path\to\wamp\bin\apache\Apachex.x.x\conf\extra\httpd-vhosts.conf
[note: x.x.x is the version of apache]
Look for NameVirtualHost *:80  and  replace it with: NameVirtualHost *
Next open the file: \wamp\bin\apache\Apachex.x.x\conf\httpd . conf
Look for  #Include conf/extra/httpd-vhosts.conf    
Delete the # (Uncomment)
Open the file: C:\Windows\System32\drivers\etc\hosts you will need the administrator account to edit this file. On windows 7 Run Notepad as admin and open the file.
For Each domain you will add the following:     www.development-domain-here.com     www.another-development-domain-here.com
Now in the file \wamp\bin\apache\Apachex.x.x\conf\extra\httpd-vhosts.conf
For Each domain add the following:
<VirtualHost *:80>
ServerName www.development-domain-here.com
DocumentRoot "C:/wamp/www/dev-site/"
<VirtualHost *:80>
ServerName www.another-development-domain-here.com
DocumentRoot "C:/wamp/www/another-dev-site/"

Remove the dummy virtual hosts and add:
<VirtualHost *:80>
ServerName localhost
DocumentRoot C:/wamp/www/
Restart the apache service.




Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>