How to access Localhost; By default the Windows 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 another local server software on their Windows computer. After installation, they can access the local server via the local IP address 127.0.0.1, but not from localhost or http://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 Windows to Allow Localhost Access
- Navigate to C:\Windows\System32\drivers\etc
- Open the hosts file with a text editor, and remark the following line:
- So it looks like this:
- Save the hosts file.
- Restart your local server and try to access it via localhost.