WAMP localhost redirects to my IP
<p>I had to recently wipe my PC and I'm setting up my development environment again using <a href="http://www.wampserver.com/en/" rel="nofollow noreferrer">WAMP</a>.</p>

<p>After installing <a href="http://www.wampserver.com/en/" rel="nofollow noreferrer">WAMP</a>, if I visit <code>http://localhost</code> instead of seeing the <a href="http://www.wampserver.com/en/" rel="nofollow noreferrer">WAMP</a> homepage I get redirected to <code>http://x.x.x.x</code>, where <code>x.x.x.x</code> is my IP.</p>

<p>I had this issue on another PC and after setting the inbound rules for Apache HTTP Server in my Windows Firewall settings to allow all domains it fixed the issue. I applied this to my PC, and the issue does not seem to be present for Internet Explorer, whereas for Chrome and Firefox the localhost to my IP redirect issue persists even after clearing the cache for each browser.</p>

<p>My <code>C:\Windows\System32\drivers\etc\hosts</code> file looks like this:</p>

<pre><code>127.0.0.1       localhost
::1             localhost
</code></pre>

<p>and my firewall rules look like this:</p>

<p><a href="https://i.stack.imgur.com/pcL1x.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pcL1x.png" alt="enter image description here"></a></p>

<p>I am not currently using vhosts and I'm on a network at my workplace (if that has any implications?)</p>

<p>I also encountered the same issue when using <a href="https://laragon.org/" rel="nofollow noreferrer">Laragon</a> which uses vhosts and whenever I visited a virtual host, e.g. mysite.dev it didn't work properly either.</p>

<p>My question on the Laragon forum: <a href="https://forum.laragon.org/topic/126/accessing-mysite-dev-redirects-to-url-which-shows-index-php-at-root-folder/3" rel="nofollow noreferrer">https://forum.laragon.org/topic/126/accessing-mysite-dev-redirects-to-url-which-shows-index-php-at-root-folder/3</a></p>