The difference between a URI, a URL, and a urn-basic knowledge
Source: Internet
Author: User
Uri:uniform Resource Identifier, Uniform Resource Identifier;
Url:uniform Resource Locator, Uniform Resource Locator character;
Urn:uniform Resource name, Uniform resource names.
Where the Url,urn is a subset of the URI.
The basic form of an address on the web is a URI, which represents a uniform resource identifier. There are two kinds of forms:
URL: The most common form of the current URI is the ubiquitous URL or Uniform Resource Locator.
An updated form of Urn:url, the Uniform Resource name (URN, uniform Resource name) is not dependent on the location, and it is possible to reduce the number of failed connections. But its popularity will take time, as it requires more sophisticated software support.
A URI is a simple string that identifies a resource in a uniform (standardized) manner.
A URI generally consists of three parts:
1. Naming mechanisms for accessing resources.
2. Host name for storing resources.
3. The name of the resource itself, represented by the path.
Typically, this string starts with scheme (the identifier for the namespace of the named Uri-a set of related names), as follows:
[Scheme:] Scheme-specific-part
The URI begins with a scheme and a colon. Scheme starts with an uppercase/lowercase letter followed by an empty or followed by more uppercase/lowercase letters, numbers, plus signs, minus signs, and dot numbers. The colon separates scheme from the Scheme-specific-part, and the syntax and semantics of the Scheme-specific-part (meaning) are determined by the namespace of the URI. As in the following example:
Http://www.cnn.com, where HTTP is scheme,//www.cnn.com is Scheme-specific-part, and its scheme is separated from Scheme-specific-part by a colon.
The URI has absolute and relative points, and an absolute URI is a URI that begins with scheme (followed by a colon). The http://www.cnn.com mentioned above is an example of an absolute URI, and other examples include mailto:jeff@javajeff.com, News:comp.lang.java.help, and Xyz://whatever. You can think of an absolute URI as a reference to a resource in a way that does not depend on the environment in which the identifier appears. If you use a file system as an analogy, an absolute URI is similar to the path of a file that starts at the root directory.
Unlike an absolute URI, a relative URI is not a URI that starts with scheme (followed by a colon). An example of it is articles/articles.html. You can think of a relative URI as a reference to a resource in a way that relies on the environment in which the identifier appears. If the file system is used as an analogy, the relative URI is similar to the file path starting from the current directory.
The URL is the abbreviation for Uniform Resource location, translated as "Uniform Resource Locator." In layman's parlance, URLs are the strings used to describe information resources on the Internet, mainly used in various WWW client programs and server programs, especially the famous mosaic. URL can be used in a uniform format to describe a variety of information resources, including files, server addresses and directories.
The format of the URL consists of the following three parts:
The first part is the agreement (or service mode);
The second part is the host IP address (sometimes including the port number) that contains the resource;
The third part is the specific address of the host resource. , such as directories and filenames.
The first part and the second part are separated by the "://" Symbol, and the second and third parts are separated by the "/" symbol. The first part and the second part are indispensable, and the third part can be omitted sometimes.
At present, the biggest disadvantage is that when the location of information resources changes, the URL must be changed accordingly. So people are looking at new ways of representing information resources, such as: URI (Universal Resource Identifier), "Common resource Identifier" (see RFC 1630), URN (uniform Resource name), "Uniform Resource Name" and URC (Uniform Resource citation) is the "Uniform Resource reference character".
The URI is still under further study. The research direction is to make up for the current shortcomings of the URL.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.