Categories
Desktop Development Web Browsers

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.

Categories
HTTP Tips & Tutorials Information Security Internet Tools Web Applications & Online Software

Make Firefox to Not Send HTTP Referer (or On a Per-Site Basis)

By default browsers such as Firefox sends the Referer information to the target URL in the HTTP header, as defined by HTTP protocol, so the destination URL / website knows where you have come from. For instance, when you click this link to one of my friends’ sites, it would know you have arrived at Princessly from this page:

https://www.kavoir.com/2012/08/make-firefox-to-not-send-http-referer-or-on-a-per-site-basis.html

Because Firefox sends this information in the HTTP header.

While this is very valuable data to many parties, such as the website owners (who can analyze traffic sources) and market analysts (who wants to know people’s interests and habits so as to sell well), it can be bad for our privacy because it is disclosing our browsing information to the websites we are visiting. You may want to disable Firefox from sending the referrer.

How to disable Firefox to send HTTP referrer?

Just type:

about:config

In your Firefox address bar and click “I’ll be careful, I promise!”.

In search, type:

referer

And an entry reading “network.http.sendRefererHeader” would come out with a value that’s 2 by default. Right click on the entry and click “Modify”. Input 0 and click OK.

Restart your Firefox, and now it should not send any referer information any more. And no website would ever know where you were before coming to them.

Not Send Referer on a Per-Site Basis in Firefox?

However, sometimes this may break something as legitimate sites are also using referer information to better serve you. There must be some sites that you don’t quite trust and wanted to disable referer for them.

Simple. Just use the RefControl add-on for Firefox.

After installation, you should see a tiny button on the Add-on Bar, at the bottom of the Firefox window. When you are at the website, click on the button and select “RefControl Options for This Site” and you will have this dialog box:

block referer in Firefox

Just select your intended option for this particular site. If you do not want to send any referer information to this site, just select “Block – send no referrer” and click OK.

That’s it. Now Firefox will send no HTTP referer information to this particular site but will keep sending it to all other sites.