tags:

views:

2378

answers:

6

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

+2  A: 

They're the same thing. A URI is a generalization of a URL. Originally, URIs were planned to be divided into URLs (addresses) and URNs (names) but then there was little difference between a URL and URI and http URIs were used as namespaces even though they didn't actually locate any resources.

Mark Cidade
I thought it was the other way around. A URL refers to a concrete object, and a URI can refer to that or a concept or anything else.
Chris Charabaruk
A URL locates a resource and is a kind of URI, which identifies a resource.
Mark Cidade
+28  A: 

From RFC 2396:

A URI can be further classified as a locator, a name, or both. The term "Uniform Resource Locator" (URL) refers to the subset of URI that identify resources via a representation of their primary access mechanism (e.g., their network "location"), rather than identifying the resource by name or by some other attribute(s) of that resource. The term "Uniform Resource Name" (URN) refers to the subset of URI that are required to remain globally unique and persistent even when the resource ceases to exist or becomes unavailable.

So any URL is a URI, but some URIs aren't URLs, they're URNs instead. Except the ones which are both URNs and URLs.

Clear as mud?

Jon Skeet
I've seen more transparent liquid soil than this, but not much. ;)
Chris Charabaruk
Only URIs with the urn: scheme are URNs. A URI could be a classic URL, a URN, or just a URI that doesn't start with "urn:" and doesn't refer to a location of a resource.
Mark Cidade
One example are InfoPath URNs, which are important i.e. in Sharepoint Workflows: urn:schemas-microsoft-com:office:infopath:blogsample:-myXSD-2004-05-19T20-48-18
Michael Stum
Note that RFC 2396 has been obsoleted by RFC 3986 a long time ago (but that doesn't change the facts...)
Julian Reschke
+1  A: 

Wikipedia will give all the information you need here... http://en.wikipedia.org/wiki/URI

"A URL is a URI that, in addition to identifying a resource, provides means of acting upon or obtaining a representation of the resource by describing its primary access mechanism or network "location"."

Peter Boughton
+10  A: 

URI => http://en.wikipedia.org/wiki/Uniform_Resource_Identifier

URL's are a subset of URI's (which also contain URNs).

Basically, a URI is a general identifier, where a URL specifies a location and a URN specifies a name.

Craig Wilson
+4  A: 

URI is kind of the super class of URL's and URN's. Wikipedia has a fine article about them with links to the right set of RFCs.

André
A: 

A list box allows you only to choose from the items in the list. A combo box is like a list box but adds a text box.You have the option of either selecting an item from the list or entering something in the text box.

Choudhary Pukhraj