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:
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.
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.
发布评论
评论(2)
a1kmm 的答案对于 URL 的特定应用很有用,但如果您对双斜杠的语义起源感到好奇,请看一下这篇文章:
http://www.w3.org/DesignIssues/Axioms.html
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
URL 的权威参考是 RFC1738,它于 1994 年 12 月发布。请参阅 http://www。 ietf.org/rfc/rfc1738.txt
引用 RFC:
后来说
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:
and later on says