localhost is not working in wamp server

120 views Asked by At

My localhost is not working, But when I type 127.0.1.1 on browser its working. When I run localhost, I get following thinglocalhost

Please advice me how to solve this.

1

There are 1 answers

0
RiggsFolly On BEST ANSWER

This looks like you have not editied your HOSTS file properly.

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

You should have at least these lines in there, UNCOMMENTED i.e. without a # in column 1

127.0.0.1  localhost
::1        localhost

It is these lines that create the domain name localhost

Once the file is edited and saved either restart Windows or use these commands from a windows command windows started using "Run as Administrator"

net stop dnscache
net start dnscahce

HOW TO EDIT THE HOSTS FILE

The hosts file is protected by windows, in order to save it you must have Administrator privilages. Vista/W7/W8 you may think you are an Administrator BUT YOU ARE NOT. To successfully save the hosts file do this to launch your editor with Admin Privileges.

Locate your editors icon on the desktop or from the Start menus ( notepad will do if you have nothing else ) right click + shift over your chosen editor icon - will show a menu. select "Run As Administrator" from the menu. Navigate your editor to the c:\windows\system32\drivers\etc\hosts file. When you have made changes you will now be allowed to save them.