Difference Between URL and URI

  • My favourite example to give for this distinction is 'news' vs 'nntp'.

    An 'nntp' URL specifies a specific message in a specific group on a specific server, hence it always has an authority part. It's also indicating to use the NNTP protocol to retrieve the message.

    A 'news' URI, on the other hand, identifies a specific message by its message ID, and leaves it to the user agent to choose a protocol and server.

    (The distinction isn't quite that clear cut, as 'news' URIs can specify a server, making them more like URLs, but I think it conveys the difference.)

  • On a somewhat related note:

    http://www.rfc-editor.org/rfc/rfc3986.txt

    From section 1.1.3:

       An individual scheme does not have to be classified as being just one
       of "name" or "locator".  Instances of URIs from any given scheme may
       have the characteristics of names or locators or both, often
       depending on the persistence and care in the assignment of
       identifiers by the naming authority, rather than on any quality of
       the scheme.  Future specifications and related documentation should
       use the general term "URI" rather than the more restrictive terms
       "URL" and "URN" [RFC3305].

  • undefined

  • I've met Jon Skeet and he sincerely is a really smashing chap. The cult of Skeet on SO is getting a tad much.

    (I find sycophantic behaviour a terrible trait)

  • undefined

  • For completeness, IRIs should be mentioned as well.

  • Multiple times I've called a URL a "URL" only to have some linked data enthusiast "correct" you by saying "you mean URI".