Network-Path Reference URI / Scheme relative URLs

//example.com/img.png is a perfectly valid URI syntax as per RFC 3986: Section 4.2. It is relative to the current scheme, and therefore as you mentioned, it can be very useful when switching between HTTP and HTTPS, because you won’t need to explicitly specify the scheme. All modern browsers will understand that format, including IE 6. … Read more

Absolute URLs omitting the protocol (scheme) in order to preserve the one of the current page

is this URL format safe to use for all browsers. I can’t say anything for sure, but you should be able to test it in different browsers. And is it a standard? Technically, it is called “network path reference” according to RFC 3986. Here is the scheme for it: relative-ref = relative-part [ “?” query … Read more

URI starting with two slashes … how do they behave?

The resource you’re looking for is the RFC 3986. See Section 4.2 and Section 5.4. Quoting from the latter: Reference Resolution Examples Within a representation with a well defined base URI of: http://a/b/c/d;p?q a relative reference is transformed to its target URI as follows: “g:h” = “g:h” “g” = “http://a/b/c/g” “./g” = “http://a/b/c/g” “g/” = … Read more

tech