The Computer Oracle

How to prevent Firefox converting 'localhost/*' URLs into search queries?

--------------------------------------------------
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------

Music by Eric Matyas
https://www.soundimage.org
Track title: Magical Minnie Puzzles

--

Chapters
00:00 How To Prevent Firefox Converting 'Localhost/*' Urls Into Search Queries?
00:49 Accepted Answer Score 24
01:12 Answer 2 Score 8
01:49 Answer 3 Score 7
02:44 Answer 4 Score 4
03:27 Answer 5 Score 4
03:48 Thank you

--

Full question
https://superuser.com/questions/382905/h...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#firefox #search #localhost #url

#avk47



ACCEPTED ANSWER

Score 24


  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://.




ANSWER 2

Score 7


  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 www.git.com you'll just get a DNS error page).

solution from Mozilla




ANSWER 3

Score 4


I know this is kind of a weird solution, but you could map localhost.com to 127.0.0.1 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:

127.0.0.1 localhost.com

to the end of the file. Save. Now you should be able to use localhost.com 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.




ANSWER 4

Score 4


As said here:

  1. Type about:config in the URL bar,
  2. Create boolean parameter browser.fixup.domainwhitelist.domain_name (replace domain_name with your local domain name, like localhost),
  3. Set new parameter's value to true.