Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Since upgrading from Firefox 3.6.x, my address bar has a quirk that never used to be there. When I type in, for example:


Firefox turns it into a search query, my search engine is Google. To work around this (after forgetting I need to do this almost every time for FF), I must type in:


This way, I am directed correctly to my localhost server. I don't need to do this for any other browser, and I thought this Q/A on URL trimming might change the behaviour, but it didn't.

Any ideas on how I can prevent 'localhost' from being turned into a search query?

share|improve this question
up vote 18 down vote accepted
  1. Type about:config in the URL bar
  2. In the filter search box, type browser.fixup.alternate.suffix
  3. Double click this entry to edit it and remove: .com

Now your localhost files should work without having to add http://.

share|improve this answer
Simple and accurate, thanks tao – danjah Jan 27 '12 at 23:32
This doesnt work for me! I've restarted Firefox and entering "localhost:4567" does a google search! – IanVaughan Feb 21 '12 at 11:35
I do not think this is the correct answer to this question, as it rather prevents FF appending .com to anything you type into the address bar. However, this works fine. For the sake of completeness: I found this setting better to use: browser.fixup.alternate.enabled, as above solution still prepended .www (there's a separete setting for this (called browser.fixup.alternate.prefix). – peterp Jan 22 '13 at 10:03
@IanVaughan With regard to the question, I consider this to be the correct answer, since it actually is about search queries:… – peterp Jan 22 '13 at 10:04
  1. In the Location bar, type about:config and press Enter.

  2. The about:config "This might void your warranty!" warning page may appear. Click I'll be careful, I promise!, to continue to the about:config page.

  3. In the Search field, type keyword.enabled.Double-click the keyword.enabled preference to set its value to false.

Please note that this will also prevent things that aren't URL-like from being used as search terms. For example, after making this change, if you type "how to tell if an egg is boiled" in the search bar, you'll just get a DNS error.

Other answers on this page give a way to attempt your suffix-less server name without modification (let's say you have a server in your domain called git, when you type just git/ and there is a DNS problem, instead of navigating to you'll just get a DNS error page).

solution from Mozilla

share|improve this answer

I know this is kind of a weird solution, but you could map to with your %windir%\system32\drivers\etc\hosts file.

Start notepad as administrator (by using the context menu on-top of it in the Start menu) and open the file %windir%\system32\drivers\etc\hosts, then add an entry like this:

to the end of the file. Save. Now you should be able to use in place of localhost, which Firefox shouldn't complain about. Note that this works for practically any domain name you want, so you can make it shorter.

share|improve this answer
I've been using this method since I discovered it a couple of weeks ago. I use This is a much simpler solution than configuring the search engines in the browser. :) – iglvzx Jan 27 '12 at 3:00
Hmm... my hosts file already has " localhost" in it, I added the new entry, saved as admin - checked, restarted Firefox... same behaviour. @iglvzx: Do you literally type in "" to the address bar after adding that to hosts? – danjah Jan 27 '12 at 3:28
@Danjah Yes, that's what I do. What did you add to your host file? – iglvzx Jan 27 '12 at 3:33
I added another line, under " localhost", "", is that correct? – danjah Jan 27 '12 at 4:49
This will work in all of your browsers, and additionally you can make it shorter (e.g. l.h should work even.) – John Chadwick Jan 27 '12 at 5:24

After trying the solutions already posted the problem was still occurring in my environment. A Google search directed to

This blog post suggested changing the browser.fixup.alternate.enabled property to false. This did the trick for me.

share|improve this answer
This solved it for me as well. Thanks, @axiopisty! – asbjornu May 9 at 19:41

To avoid this problem, I configured Firefox to always show the http:// protocol in URL bar.

In about:config, set browser.urlbar.trimURLs to false (

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .