4 ms·
From Berners-Lee's FAQ: https://www.w3.org/People/Berners-Lee/FAQ.html https://www.w3.org/People/Berners-Lee/FAQ.html Q: What is the history of the //? A: I w
by dybfjbxybff 6y ago
From Berners-Lee's FAQ: https://www.w3.org/People/Berners-Lee/FAQ.html https://www.w3.org/People/Berners-Lee/FAQ.html
Q: What is the history of the //?
A: I wanted the syntax of the URI to separate the bit which the web browser has to know about (www.example.com) from the rest (the opaque string which is blindly requested by the client from the server). Within the rest of the URI, slashes (/) were the clear choice to separate parts of a hierarchical system, and I wanted to be able to make a link without having to know the name of the service (www.example.com) which was publishing the data. The relative URI syntax is just unix pathname syntax reused without apology. Anyone who had used unix would find it quite obvious. Then I needed an extension to add the service name (hostname). In fact this was similar to the problem the Apollo domain system had had when they created a network file system. They had extended the filename syntax to allow //computername/file/path/as/usual. So I just copied Apollo. Apollo was a brand of unix workstation. (The Apollo folks, who invented domain and Apollo's Remote procedure call system later I think went largely to Microsoft, and rumor has it that much of Microsoft's RPC system was).
I have to say that now I regret that the syntax is so clumsy. I would like http://www.example.com/foo/bar/baz http://www.example.com/foo/bar/baz to be just written http:com/example/foo/bar/baz where the client would figure out that www.example.com existed and was the server to contact. But it is too late now. It turned out the shorthand "//www.example.com/foo/bar/baz" is rarely used and so we could dispense with the "//".