It is confusing to a lot of people, but they aren't functionally interchangeable.
Basically you have Uniform Resource Locators (URLs), Uniform Resource Names (URNs), and Uniform Resource Identifiers (URIs). You also have International Resource Identifiers (IRIs), which are URIs with rules allowing for international character sets in things like host names.
Every URN and URL is a URI.
However, not every URI is a URN, or a URL.
A URN has a specific scheme (the front part of a URI before the :), but it does not contain instructions on how to access the identified resource. We humans might automatically map that to an access method in our head (e.g., digital object identifier URNs like doi:10.1000/182, which we who have used DOIs know maps to http://dx.doi.org/10.1000/182), but the instruction isn't in the URN.
A URL is not just an identifier but also an instruction for how to find and access the identified resource.
For example http://example.org/foo.html says to access the web resource /foo.html by using the HTTP protocol over TCP to connect to IP address which example.org resolves to, on port 80.
An example of URIs which are not URLs are the MIME content ids used to mark the boundaries within an email (cid scheme), e.g., cid:foo4%25foo1@bar.net.
IMHO the distinction between URL and URI is similar to the debate on SI prefixes for bytes, or whether we should insist on calling Linux GNU/Linux; i.e., most people just don't care enough so these things will never gain currency.
Yep. The WHATWG recommends just using the term URL instead of URI.
> Standardize on the term URL. URI and IRI are just confusing. In practice a single algorithm is used for both so keeping them distinct is not helping anyone. URL also easily wins the search result popularity contest.
Thank you so much! I needed an authoritative source to throw at people when they try to belittle me for using URL, instead of URI. To me, URL just sounds better.
Basically you have Uniform Resource Locators (URLs), Uniform Resource Names (URNs), and Uniform Resource Identifiers (URIs). You also have International Resource Identifiers (IRIs), which are URIs with rules allowing for international character sets in things like host names.
Every URN and URL is a URI. However, not every URI is a URN, or a URL.
A URN has a specific scheme (the front part of a URI before the :), but it does not contain instructions on how to access the identified resource. We humans might automatically map that to an access method in our head (e.g., digital object identifier URNs like doi:10.1000/182, which we who have used DOIs know maps to http://dx.doi.org/10.1000/182), but the instruction isn't in the URN.
A URL is not just an identifier but also an instruction for how to find and access the identified resource.
For example http://example.org/foo.html says to access the web resource /foo.html by using the HTTP protocol over TCP to connect to IP address which example.org resolves to, on port 80.
An example of URIs which are not URLs are the MIME content ids used to mark the boundaries within an email (cid scheme), e.g., cid:foo4%25foo1@bar.net.
You can get more information at: https://tools.ietf.org/html/rfc2392