Difference between URL and URI

URL

1. Abbreviation: URL stands for Uniform Resource Locator

2. Meaning: URL is a subset of URI that specifies where an identified resource is available and the mechanism for retrieving it.Meachanism actually means one of the potocol schemes (e.g., http, ftp, file, mailto) provided by URI.

3. Examples:

• http:/www.dotnetfunda.com/users/login.aspx

Here, http is the protocol, dotnetfunda.com is the domain name, users is the folder name, login.aspx is the filename

http://dotnetfunda.com/articles/default.aspx

Here http is the protocol, dotnetfunda.com is the domain name, articles is the folder name and default.aspx is the file name

URI

1. Abbreviation: URI stands for Uniform Resource Identifier

2. Meaning: A URI is a superset of URL that identifies a resource either by location (URL), or a name(URN), or both (URL and URN).

3.Examples:

http://www.dotnetfunda.com

• /some/page.html

Summary:

1.A URI is either a URL or a URN.

2.Every URL is a URI.

3.Every URN is a URI.

4.A URN is never a URL.

5.A URL is never a URN.

6.Every URI is not a URL

7.If the URL describes both the location and name of a resource, the term to use is URI. Since this is generally the case most of us encounter everyday, URI is the correct term.

Here,

URI --> A Uniform Resource Identifier(URI) is used to identify something on the World Wide Web.

URN --> Uniform Resource Name (URN), a type of URI, basically states what something is, but do not have information on how to access it.

URL --> Uniform Resource Locator (URL), a type of URI, contains the location of something and tell the client program (usually a browser) how to access it.

Simply put, a URN is the name of something and the URL is the name and address.