When going to a website we see https://example.com, I know the purpose of http and https protocols, but what is the purpose of "://" after? I know "\" is being used for directories, but still dont explain the ":"

  • '\' is used for directories in Windows only, I think what you meant is / .
    – schaiba
    Dec 5 '19 at 9:11
  • Unfortunately, questions about protocols above OSI layer-4 are off-topic here. You could try to ask this question on Server Fault for a business network.
    – Ron Maupin
    Dec 5 '19 at 14:05

':' separates the protocol and the resource.

The basic idea is that a path starting with '/' indicates the root of a device/volume etc. So, '//' is used to indicate the "top of the network", followed by the server name.

In a URL, this scheme can be used to indicate relative paths on the same resource, e.g. http:/index.html for a file in the root of the current server, or http:pic.gif for a file in the same directory on the current server.

Microsoft Windows generally uses backslashes ('\' and '\\') instead of the forward slashes because PC DOS 1.0 already used '/' as a commandline option indicator before subdirectories were introduced in PC DOS 2.0.


Check out the explanation on this Wikipedia page.

https://en.wikipedia.org/wiki/URL [Under 'Syntax']

  • to be more precise, it's only a convention used to separate the different parts that make up an URL : $protocol://$host/$directory[:$port] .
    – schaiba
    Dec 5 '19 at 9:11
  • @schaiba The [:$port] bit needs to be following the $host. ;-)
    – Zac67
    Dec 5 '19 at 12:10
  • right, thank you.
    – schaiba
    Dec 5 '19 at 12:23

Not the answer you're looking for? Browse other questions tagged or ask your own question.