Force Chrome to open URLs as URLs, instead of searching

81

20

I have a local Apache server running, which is defined through /etc/hosts as "apache". So I often open pages like:

http://apache/website/

Normally, this works fine. However, since I am using a more recent Chrome browser, at odd moments the browser decides that the URL I type is not a URL but actually a search, so it loads my default search engine and tries to find this URL. It often, but not always, shows a link under the address bar that says Did you mean to go to http://apache/website?. That is nice, but very annoying having to click here instead of going there directly. What makes Chrome behave this way? Can I fix this?

user95156

Posted 2011-11-05T22:50:14.837

Reputation:

Answers

57

I had the same problem and i found that typing the / at the end will always treat it as a url instead of keyword.

For example in my case :

local.dev/ben is treated as search

but

local.dev/ben/ its working fine

chifliiiii

Posted 2011-11-05T22:50:14.837

Reputation: 687

2Does not work for my improved nodejs server http://0.0.0.0:8080/bla/ Does not work! – hitautodestruct – 2015-05-25T14:52:50.990

2@hitautodestruct 0.0.0.0 is not a valid ip address, it's a placeholder address that generally means default route in routing, or all ipv4 addresses on the host for services. You would need to reach it via a valid ip address assigned to your host. – Steve Buzonas – 2017-01-16T20:53:13.900

2Saying that appending a / at the end will always treat it as a url instead of a keyword does not always hold true, for example scoped link local addresses will trigger a search even if a / is present: https://[fe80::1%eth0]/ – Tiernan – 2013-09-26T08:59:06.893

34

You can implicitly do this by creating a new search engine with a URL of http://%s and keyword of null. Then, set this as the default search engine.

To get to the search engines page in chrome:

  • Open Settings panel.
  • Click Manage search engines... button under Search heading.
  • Search Engines pane has two sections: Default search engines and Other search engines
  • At the bottom of the Other search engines section, you'll see a form which we'll make use to add a new search engine.

Search Engines

iglvzx

Posted 2011-11-05T22:50:14.837

Reputation: 21 611

I used "htp://localhost/%s%", thinking that that would save a DNS lookup and get a "This web page is not available" result sooner. Does that make sense? (I actually used http, not htp, but this page would display it as a link instead of just text. I don't know how to display an URL as text). Thanks for a solution to this annoyance. – user184411 – 2015-09-08T00:32:50.630

This works, but Chrome keeps adding a freaky trailing slash / to all urls. Chrome should burn in hell! – Marco Demaio – 2019-01-07T16:48:50.670

2That's a neat trick. I'll have to try it out! – afrazier – 2011-11-06T01:27:52.367

3@iglvzx Thanks, but this only works if I always want to open any keyword this way. I really like to keep using Google Search when typing other words, but I just don't want this to happen when I am typing a localhost URL. – None – 2011-12-28T22:02:30.593

1It's no longer possible to set 'null' as keyword as of Chrome v26. – skolima – 2013-04-08T13:20:52.080

1@skolima It's possible in v27.0 – svandragt – 2013-05-14T10:03:33.703

1@svandragt: v27 is now stable and unfortunately this is still disabled. Crap. – skolima – 2013-05-22T09:58:34.023

Update as of Chrome v33: you can add the "null" keyword, but this does not solve the problem. – Niels Bom – 2014-04-04T15:14:42.313

14

I got annoyed by this as well. I recently found out what caused it. Try disabling 'Use a web service to help resolve navigation errors'.

Rik

Posted 2011-11-05T22:50:14.837

Reputation: 157

1In Chrome 54 this is in "Show Advanced Settings" on the bottom of about://settings page. – Daniel W. – 2016-11-23T09:00:53.373

4This does not work if I then add to the URL. e.g. I load local.symphony-2.3 and then add /symphony or /symphony/ to the URL, chrome searches google for that phrase. – codecowboy – 2012-04-20T07:50:17.460

2

In latest chrome settings - Advanced settings

enter image description here

Mohamed Alikhan

Posted 2011-11-05T22:50:14.837

Reputation: 121

Rik supplied this answer six years before you did: https://superuser.com/a/394874/84181

– Eric – 2019-04-27T16:55:49.560

Rik's answer is seven years out of date. Mohamed Alikhan provides an updated screenshot from the newer version of the browser and that's very helpful in my opinion. – Blisterpeanuts – 2019-05-23T15:01:20.740

2

If you know the port you're using, you can specify it by hand like

url:80/index.html

instead of

url/index.html

In the first case, it won't be treated as a search request

Masadow

Posted 2011-11-05T22:50:14.837

Reputation: 129

Doesn't work in Chrome 69 even using :80 – Marco Demaio – 2019-01-07T16:44:31.507

1

Here's how to disable the ability to make searches from the address bar (omnibox) of Google Chrome:

  1. Open Google Chrome.
  2. Type chrome://flags in the address bar and press Enter.
  3. Scroll to Enable search button in Omnibox.
  4. Select Disabled.

mohammed

Posted 2011-11-05T22:50:14.837

Reputation: 11

1I don't have this option; what version are you using? – Ben N – 2016-02-02T01:13:50.820

0

I had the same issue with Chrome on my Android phone. I resolved it similar to @Rik suggestion.

For mobile Chrome:

  1. Go to Settings -> Privacy
  2. Untick Navigation error suggestions

nkatsar

Posted 2011-11-05T22:50:14.837

Reputation: 101

i had to untick "navigation error suggestions" and "search and site suggestions" (the first two options) before chrome stopped turning my urls to search queries. afterwards i could enable both settings and chrome still opened my urls as it should. bad chrome. bad propietary black box chrome. i am using firefox kthxbye – lesmana – 2018-04-30T12:20:32.680

0

Try add correct url to browser bookmarks. Then Chrome suggests this address on the first place (marked with star).

chrome omnibox

Axis

Posted 2011-11-05T22:50:14.837

Reputation: 23

It's unusual to have a hostname as short as a single character. Chrome is suggesting file:/// because a: is a drive letter. Same if you typed "c:\Users", "a:81" is a file named "81" on the "a" drive. This is of course assuming your using Windows. – zaTricky – 2019-08-14T10:21:00.043

I do not recommend domain 'a', it is just proof that it works. Because i think that complete disable search from address line is not good solution. But good point. – Axis – 2019-08-15T11:46:09.587

0

I had to add google.co.in with the search string: http://google.com/search?q=%s to get both Google Search and URL search working.

Now if I want to browse URL I can just append 'http://whatever' and choose if i want to do a URL navigation or search.

@iglvzx's answer no longer seems to work in version 40 of Chrome. It looks like Null is not a valid entry anymore. I had to improvise as above to get this working.

noob Mama

Posted 2011-11-05T22:50:14.837

Reputation: 101

Hmm not working for me on Chrome 40. What an odd bug. – jfroom – 2015-01-28T20:47:45.187