Question

People talk about URLs and URIs as if they're different things, but they look the same. What's the difference between the two?

Thanks.

Was it helpful?

Solution 2

URI = General identifier.

URN = Subtype of URI. General name.

URL = Subtype of URI. General locator.

In most cases they will be the same.

OTHER TIPS

Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet

An URI identifies a resource either by location, or a name, or both. A URI has two specializations known as URL and URN.

An Uniform Resource Locator (URL) is a subset of the Uniform Resource Identifier (URI) that specifies where an identified resource is available and the mechanism for retrieving it.URL defines how the resource can be obtained. It does not have to be HTTP URL (http://), a URL can also be (ftp://) or (smb://)

An Uniform Resource Name (URN) is a Uniform Resource Identifier (URI) that uses the URN scheme, and does not imply availability of the identified resource. Both URNs (names) and URLs (locators) are URIs, and a particular URI may be both a name and a locator at the same time.

The URNs are part of a larger Internet information architecture which is composed of URNs, URCs and URLs.

bar.html is not a URN. A URN is similar to a person's name, while a URL is like a street address. The URN defines something's identity, while the URL provides a location. Essentially, "what" vs. "where". A URN has to be of this form <URN> ::= "urn:" <NID> ":" <NSS> where is the Namespace Identifier, and <NSS> is the Namespace Specific String.

To put it differently:

A URL is a URI that identifies a resource and also provides the means of locating the resource by describing the way to access it
A URL is a URI
A URI is not necessarily a URL
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top