That's going to look at the structure of uri[1].
scheme:[//[user:[email protected]]host[:port]][/]path[?query][#fragment]
As you can see, if there is a host, the front is to add//, so for HTTP and other network addresses in terms of
http://www.baidu.sb:80/ad/cash
It's natural to write like this.
So what if it's a file? File because there is no host ah, so the middle part is not, then it becomes
file:///ad/cash
For the document, it seems that//do not have any relationship
In fact, according to the above definition, the following is correct. Because if there is no host, the first [] content should not exist ah.
file:/ad/cash
This unified writing also has a standard, called curie[2].
In fact, the beginning of the/also can not be, just to see if you are the absolute address, is generally used absolute address.
Jong Teng
Links: https://www.zhihu.com/question/37063799/answer/70242462
Source: Know
Copyright belongs to the author. Commercial reprint please contact the author for authorization, non-commercial reprint please specify the source.
Why does the URI have a local file followed by three slashes, HTTP, and so on with two slashes?