Hacker News new | ask | show | jobs
by dr_j_ 2144 days ago
Given the standard RFC, the two initial slashes as in scheme:// are critical in any URL when you need to be able to distinguish between the authority and path component, as in scheme://authority/path as in http://server/file.txt. Otherwise it would be impossible to know when the server part finished and the path part began (since the authority or server part is always between the second and third slashes). Given the article, I think we’re very lucky to have ended up with this design. But I suppose we could have also arrived at a syntax where the path begins with the second slash (e.g. scheme:/server/path). In fact scheme:/path is valid syntax and is simply the contracted URL form of scheme:///path so at least by today’s RFC definition, scheme:/server/path wouldn’t work since in this contracted form, the path begins with the very first slash and that ‘server’ bit wouldn’t be a server at all but also part of the path.