how to add virtual host in wamp server

In this tutorial we shown, how to add virtual host in wamp server on windows machine. You just need to follow our steps to setup virtual host in wamp server.

how to add virtual host in wamp server

Many PHP developers use the wamp server for development. For creating the virtual host just open the httpd.conf file from following location.

how to add virtual host in wamp server

how to add virtual host in wamp server


C:\wamp\bin\apache\Apache2.2.11

Then un-comment the following line


# Virtual hosts
Include conf/extra/httpd-vhosts.conf

Than open the httpd-vhosts.conf file from following location


C:\wamp\bin\apache\Apache2.2.11\conf\extra\

un-comment the following line


NameVirtualHost *:80

then put the following lines in that file



#ServerAdmin webmaster@dummy-host.localhost
DocumentRoot "C:/wamp/www"
ServerName localhost
ServerAlias localhost
ErrorLog "logs/localhost-error.log"
CustomLog "logs/localhost-access.log" common
<!--<span class="hiddenSpellError" pre="" data-mce-bogus="1"-->VirtualHost>


#ServerAdmin webmaster@dummy-host2.localhost
DocumentRoot "C:/wamp/www/wordpress"
ServerName wordpress.purab.com
ErrorLog "logs/wordpress.purab.com-error.log"
CustomLog "logs/wordpress.purab.com.log" common


Then restart the wamp server. Dont forget to update the hosts file from your system

Open the hosts file from following location.


C:\Windows\System32\drivers\etc

put entry like this.

127.0.0.1       localhost    localhost.localdomain    local.purabtech.in

Have fun!

Add a Comment

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