0

Today I was trying to google the header file linux/cleanup.h, but surprisingly when I typed it in Safari address bar, it redirect me to https://linux.com/cleanup.h. In fact, simply http://linux/ will also get redirects to https://www.linux.com.

Anyone know why does Safari redirects such page? As it doesn't happen to, let's say http://google/. And I don't think this is a local DNS config quirk, as I cannot replicate such behaviour on either terminal or Firefox.

MacOS: Tahoe 26.1, re-tested without any extension, same behaviour even with private browsing.

Edit: tried with another random word, http://archlinux/ (I'm adding http:// to force Safari to resolve it as a top-level domain), it redirects to http://archlinux.com/, of which I can confirm I did not visited before (as the homepage of Arch Linux is on .org.

4
  • 1
    I can't replicate this in Tahoe. Please update the question with your macOS version. Also, if you're running any Safari extensions, disable them and test. Commented 2 days ago
  • I was able to reproduce it with http://linux/ and http://archlinux/, but not linux/cleanup.h. I don't use Safari much (Chrome is my primary browser), so I don't have any history with these sites. It looks like it's just a form of auto-correct to me. Commented yesterday
  • How certain are you no Safari history exists? Does this happen in private window? Have you disabled all auto complete for Safari? (Names, addresses, passwords, etc…) Commented yesterday
  • @bmike yes I've gone to history and removed all items related. For the archlinux case, the only left history are from archlinux.org (as oppose to .com) Commented yesterday

2 Answers 2

1

The "address" bar is also a "search" bar. I suspect that Safari is trying to interpret which usage you intend and then getting it wrong!

You started the question with "Today I was trying to google the header file linux/cleanup.h". I take that to mean you wanted to search the web for the phrase linux/cleanup.h.

The sure way to force a web search (with your default search engine) is to enclose the linux/cleanup.h in quotation marks. So type "linux/cleanup.h". Then you will go to the search engine results.

When entering something in the address/search bar, keep an eye on the icon displayed there - is it a "globe" or is it a magnifying glass. Safari seems to switch to the globe if it is something which is at least partially in your history or is structurally like a URL.

I was able to reproduce your redirect to www.linux.com, but only after I had visited that site.

2
  • I know that often the address bar might mistook a search with web address, which I often have to select the google option in the dropdown suggestions to force a search. (TIL that you can use it with quote.) But my main question is why does it only happened with linux and not for, let's say, google? B.c. obviously I've also visited google.com before. (I've also deleted browsing history for linux.com but the behaviour persists, might be some cacheing stuff tho, but can confirm I did visited linux.com in the past) Commented yesterday
  • All I can say is that it seems that one's Safari history is involved as well as the text entered looking a bit like a URL. I suspect that google could be different because it is a search engine and, in your case, the default search engine. The main thing is to know how to force a search when Safari might want to convert it into a URL. Commented yesterday
0

In the case of http://linux/ and http://archlinux/, this looks like auto-correct to me. When the hostname part of a URL is just a single component (no . character) the browser will first try to interpret it as a top-level domain or a name in the default domain. If this fails, it applies heuristics like adding the .com suffix and www. prefix (although redirecting XXX.com to www.XXX.com is often done by the site itself).

I wasn't able to reproduce the redirection of linux/cleanup.h to https://linux.com/cleanup.h, so I think this must be an additional heuristic based on your browsing history.

In general, if something looks like a partial URL, Safari will try to figure out what full URL you intended. linux/cleanup.h looks more like a URL, because of the /, than a search term. Ever since browsers have integrated search into the address bar we've lived with ambiguities and occasional misunderstandings like this.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.