How to Access Localhost in Vista

By default the Windows Vista TCP IP stack does not allow access to a local server using localhost. Many people find this out the hard way, after having installed XAMPP or other local server software on their Windows Vista PC. After installation, they can access the local server via, but not via localhost. In the following simple solution, I will show you how to resolve this problem and regain access to your XAMPP server using localhost once again.

Fix Vista to Allow Localhost Access

  1. Navigate to C:\Windows\System32\drivers\etc
  2. Open the hosts file with a text editor, and remark the following line:

    ::1             localhost

  3. So it looks like this:

    #::1            localhost

    Editing the hosts file to allow localhost access in Windows Vista

  4. Save the hosts file
  5. Restart your local server and try to access it via localhost