views:

213

answers:

2

Anybody knows where the "://" or the "//" comes from in most URIs syntaxes? For instance, why isn't it written like "http:www.example.com"?

+6  A: 

The definitive reference on URLs is RFC1738, which came out in December 1994. See http://www.ietf.org/rfc/rfc1738.txt

To quote from the RFC:

URLs are written in general as <scheme>:<scheme-specific-part>

and later on says

While the syntax for the rest of the URL may vary depending on the particular scheme selected, URL schemes that involve the direct use of an IP-based protocol to a specified host on the Internet use a common syntax for the scheme-specific data:
//<user>:<password>@<host>:<port>/<url-path>
Some or all of the parts "<user>:<password>@", ":<password>", ":<port>", and "/<url-path>" may be excluded. The scheme specific data start with a double slash "//" to indicate that it complies with the common Internet scheme syntax.
a1kmm
+10  A: 

a1kmm's answer is good for specific application to URLs, but if you're curious as to the semantic origin of the double slash, take a look at this article:

http://www.w3.org/DesignIssues/Axioms.html

It is worth noting that the syntax with the double slash can in fact be extended for use with a triple slash if one wanted to be able to start at any level in a much more complicated hierarchical structure. For example, suppose international telephone numbers were to be extended to cover a planetary code in the future. Then the planetary code could be attached to the front of the international code. The triple slash could introduce the interplanetary code, and the double slash would introduce the international code. Indeed, this is how the double slash came to be: when hierarchical naming schemes such as those in unix file systems was extended to a networks file system on the Apollo domain the extra slash was introduced. Similarly, Microsoft NT networking now uses double backslash in exactly the same way.

Amber
A lot of internet "syntax" is based on the Apollo domain system -- eg the @ symbol in an email address, the fact that a hostname goes "small.medium.big", whereas the unix path goes /big/medium/small. I think Berners-Lee talks about it in his autobiography, Weaving the Web. He even mentions that he thought about going full unix, and having //com/stackoverflow/www/questions/1388194/origin-of-in-many-uri-syntaxes
Pod