Hacker News new | ask | show | jobs
by dbrock 5465 days ago
URL detection is tricky because people omit the “http://” part of URLs. It used to be that you could look for stuff beginning with “www.”, but nobody uses “www.” anymore, so now you basically have to have a list of TLDs and look for anything ending in “.<tld>”. Now that everybody will be able to register their own TLD, will URL detection even be feasible for humans any more? I’ve been thinking about how we’re going to solve this problem for a while, because we need some kind of notation to replace “.<tld>”. I mean I don’t think people will go back to writing <http://coca-cola>, so when I saw the title of this post I immediately knew what the idea was: let’s write //coca-cola to denote “the URL coca-cola”. (Unfortunately, both Google Chrome and Safari interpret “//coca-cola” as “file:///coca-cola”.)

I don’t know why everybody is talking about the technical meaning of //coca-cola, as that’s kind of irrelevant. Us web developers will of course still be typing the full http://coca-cola, as we always have.

2 comments

> nobody uses “www.” anymore

Except for the vast majority of high volume sites that know how to balance traffic and don't show "fail whales" every couple days.

Visit google.com, yahoo.com, amazon.com, msn.com, etc, and watch your URL get fixed to correctly reflect the local hostname "www".

Even coca-cola.com. You can type it wrong as you always have, and they'll fix it for you to be "http://www.coca-cola.com/.

I thought this might be an issue when they did generic TLDs, but as far as I can see they are only selling to registrars, so they are not expecting web sites at the top level, there will still be a subdomain, and browsers will probably not go to the top level domains.

Interestingly, http://dk/ has a valid A record to 193.163.102.24 which curl will show is a 301 redirect, but you cannot load it in Chrome or Firefox. dk has MX records too (I remember an old story about someone who had the email address m@dk or similar), but I think generally having any records for the top level is frowned upon now.