After installing WAMP on Windows Vista we came across a problem where we cannot access the default website using http://localhost – The name just doesn’t seem to resolve.

For some reason in Vista and Windows 7 localhost doesn’t work out of the box. To get it working you have to add this line to the c:\windows\system32\drivers\etc\hosts file:      locahost

Now the hosts file is a Windows system file so the only way Windows will allow you to edit the file is if you do it as Administrator. To do this click Start and type CMD in the search box, when Windows shows cmd.exe right-click it and click run as administrator then when the DOS box opens type:

edit c:\windows\system32\drivers\etc\hosts

Then add the localhost line and save and close the file.  Then localhost should work as it did in XP.