4

I use URLs all the time typing them in with and without "//" after the "http:" but what does the "//" really stand for?

non sequitor
  • 143
  • 3

7 Answers7

9

Slashdot had an article about this a couple of days ago. Tim Berners-Lee indicates that there was no particular reason why the two slashes are there (see also http://bits.blogs.nytimes.com/2009/10/12/the-webs-inventor-regrets-one-small-thing/).

Personally, I like the idea of this style of URL:

http:/com/example/www/blah1/blah.html

There's no explicit "hostname" in such an URL. If your "www.example.com" server farm becomes overburdened with requests to the "/blah1" resource, you just create a "blah1.www.example.com" DNS record and point it to another web server farm that hosts the "/com/example/blah1" resource hierarchy.

No doubt there are DNS implications with such an idea, and it surely won't happen now (any more than suddenly having clocks that run counterclockwise coming into style), but I think it would've worked rather well.

Edit: SRV RR's for web sites would've been really nice, too. Hell-- SRV RR's for anything would be nice.

Evan Anderson
  • 141,881
  • 20
  • 196
  • 331
3

There is an answer for that in Tim Berners-Lee's FAQ (link found in the slashdot discussion mentioned at @Evan Anderson's answer). Basically, he copied the filename syntax from Apollo Domain, where starting a path with a double slash followed by the name of a computer was used to transparently access files in other computers (a single slash is still the root directory). He simply prepended it with the protocol, in this case http.

That special case still exists in the Unix standards, where two slashes at the beginning of a file name may be interpreted in an implementation-defined manner (three or more slashes are equivalent to just one). And the same convention is widely used in Windows, only with backslashes instead of forward slashes (it is called a UNC path there).

CesarB
  • 2,448
  • 1
  • 16
  • 9
  • Another relevant slashdot comment: http://tech.slashdot.org/comments.pl?sid=1404183&cid=29744723 – CesarB Oct 16 '09 at 20:02
  • "two slashes at the beginning of a file name may be interpreted in an implementation-defined manner" I had **never** heard that before. +1 – wfaulk Oct 16 '09 at 21:44
2

xx:// is used to specify the protocol used, it's a double / so it can't be confused with just being a subfolder.

Dentrasi
  • 3,752
  • 1
  • 24
  • 19
  • Yeah, but "//" is perfectly legal in an URL. Lots of web servers just treat it as "/" and move on. – Evan Anderson Oct 16 '09 at 18:43
  • 1
    Webservers (or any software using URIs) have to treat "//" as "/" in the path segment of URIs. You might want to read section 6 ("Normalization and Comparison") of RFC 3986 (http://www.ietf.org/rfc/rfc3986.txt). – joschi Oct 17 '09 at 09:40
1

Tim Berners-Lee admits that this was intended to separate the protocol for the address, but turned out to be unnecessary.

http://www.theinquirer.net/inquirer/news/1558680/berners-lee-regrets-double-slash

Nicolas Webb
  • 179
  • 1
  • 7
  • This useful when you want to chain two or more protocols or pseudo-protocols, even if, I believe, it's not standard. Firefox and Chrome IIRC use it for displaying the source, something along the lines of: source:http://blah.com – niXar Oct 17 '09 at 13:34
1

See RFC 1738, section 3.1:

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.

Sinan Ünür
  • 331
  • 4
  • 12
1

It think it literally means "Whack! Whack!", from the really early times where actually getting a connection to a site demanded some voodoo and you had to sacrifice (whack) not one, but TWO chickens to please the WorldWideWeamons.. :)

tplive
  • 444
  • 2
  • 9
0

It signifies the root of the address.

Michael Pobega
  • 934
  • 5
  • 12