Firefox redirecting localhost to www.localhost.com

To avoid this annoying behavior of Firefox that redirects http://localhost to http://www.localhost.com when you are developing on the localhost, try one or more of the following tips:

  1. Use other browsers such as IE or Chrome.
  2. Use “127.0.0.1” instead of “localhost”.
  3. Make sure http://localhost is correctly configured and responding.
  4. Make sure C:\Windows\System32\drivers\etc\hosts has and only has “127.0.0.1    localhost“. Comment out “::1    localhost” which is for IPv6.
  5. Disable Firefox web address automatic alternate fixup: 1) about:config, 2) browser.fixup.alternate.enabled = false
  6. You can also disable IPv6 in Firefox or even disable IPv6 entirely at OS level but it’s not recommended. How? Search for yourself!
  7. Should you be debugging PHP, include these at the top of your code to make sure PHP gives the error for you to erase the underlying problem:
    ini_set('display_errors','On');
    ini_set('error_reporting',E_ALL);
    ini_set('max_execution_time', 180);
    ini_set('memory_limit','1024MB' );

I would prefer 2 and 5.

Scroll to Top