Relative URLs relative URLs?

So, consider a protocol-relative URL , for example:

//www.example.com/file.jpg

The idea that I had in my head as long as I remember is that the relative protocol URLs are actually absolute URLs. They behave exactly like absolute URLs, and never work as relative URLs. I would not expect this to make the browser find something in

http://www.example.com///www.example.com/file.jpg

The URL defines the host and the path (for example, an absolute URL), and the scheme is inherited from any page used, and therefore it makes a complete unambiguous URL, i.e. absolute url.

Right?

Now, after further research on this, I came to this answer , which says:

A URL is called an absolute URL if it starts with a scheme and a specific scheme (here //after http:). Everything else is a relative URL.

Neither the question nor the answer specifically discusses the relative URLs of the protocol, so I remember that it might just be an oversight in the wording.

However, now I now have a problem in my development, when a system that accepts only absolute URLs does not work with protocol-related URLs, and I don’t know if this is by design or because of an error.

the RFC3986 section , which is often associated with protocol-related URLs, also splashes the word "relative" around a large number. 4.3 it follows that absolute URIs define a scheme.

:

URL- ?

+5
2

URL- URL-, URL-, . , http://mypage.com/some/folder/, , URL this/that http://mypage.com/some/folder/this/that, , URL //otherpage.com/ http://otherpage.com/. , URL- .

URL - URL-, - . URL- aboslute - .

+3

, " URL", WHATWG "URL-, " URL Standard, URL-, URL-.

, , HTTPS, HTTP-URL, , URL, , .

:

URL scheme, ":", URL- , scheme , , ?? query.

, , :

A URL URL- , URL- URL-, scheme ":", "?" query.

, URL , URL .

( )

URL- [path segment][/[path segment]]…

  • about
  • about/staff.html
  • about/staff.html?
  • about/staff.html?parameters

URL URL-: /[path-relative URL]

  • /
  • /about
  • /about/staff.html
  • /about/staff.html?
  • /about/staff.html?parameters

URL- : //[userinfo@]host[:port][absolute-path-relative URL]

  • //username:password@example.com:8888
  • //username@example.com
  • //example.com
  • //example.com/
  • //example.com/about
  • //example.com/about/staff.html
  • //example.com/about/staff.html?
  • //example.com/about/staff.html?parameters

URL: scheme:[scheme-relative URL][?parameters]

  • https://username:password@example.com:8888
  • https://username@example.com
  • https://example.com
  • https://example.com/
  • https://example.com/about
  • https://example.com/about/staff.html
  • https://example.com/about/staff.html?
  • https://example.com/about/staff.html?parameters

URL:

  • , URL-
  • , URL- URL-
  • , URL- URL-

. , , . , , .

+1

All Articles