Why does http:// contain two slashes and file:/// three in a browser navigation bar?

后端 未结 2 1569
北恋
北恋 2021-02-01 23:10

Why does http:// contain two slashes—is that just a standard for a URL, or does it have any logical meaning? And why does file:/// contain three slashe

2条回答
  •  独厮守ぢ
    2021-02-01 23:26

    As mentioned in this superuser post:

    The complete syntax is file://host/path.

    If the host is localhost, it can be omitted, resulting in file:///path.

    In other words, referring to files in your computer is just like referring to files in localhost.

提交回复
热议问题