Source:
http://codingpad.maryspad.com/2009/11/08/how-to-set-up-virtual-hosts-on-your-localhos/
Goal: You have local copy of www.site and you want to access this through the url www. site.dev
Edit your hosts file (administrator rights needed), usually located in C:\Windows\System32\drivers\etc\
Add for example this:
# local development 127.0.0.1 www.site.dev
Now open up httpd.config (you can open it from Wamp > Appache) and uncomment this line:
# Virtual hosts
#Include conf/extra/httpd-vhosts.conf
open the httpd-vhosts.conf (located in wamp->bin->apache->Apache2.2.11->conf->extra)
And add something like this:
(Documentroot and ServerNamer are the important entries)
<VirtualHost *:80> ServerAdmin admin@site.dev DocumentRoot "D:/webdev/projects/site" ServerName site.dev ServerAlias www.site.dev ErrorLog "logs/site.dev-error.log" CustomLog "logs/site.dev-access.log" common </VirtualHost>
Finally, if the site folder is not in the wamp/www directory, create an alias as follows:
Alias /site.dev "d:/webdev/projects/site/" <Directory "d:/webdev/projects/site/"> Options Indexes FollowSymLinks MultiViews AllowOverride all Order allow,deny Allow from all </Directory>
See also this post
Restart WAMP after you have done all this.