The difference between a URL and a URI

Source: Internet
Author: User

URL (Uniform Resource location) Uniform Resource Locator (or Uniform Resource Locator). That's what you always say.

URLs can be used in a unified format to describe various information resources, including files, server addresses and directories.

The format of the URL format URL is composed of the following three parts:
The first part is the agreement (or service mode);
The second part is the host IP address (and sometimes the port number) where the resource is stored;
The third part is the specific address of the host resource. , such as directory and file name.
The first and second sections are separated by a "://" Symbol, and the second and third sections are separated by a "/" symbol. The first part and the second part are indispensable, and the third part can be omitted sometimes.

URI (Uniform Resource Identifier) uniform Resource identifier;

URIs are generally made up of three parts:

① naming mechanism for accessing resources

② host name of the storage resource

The name of the ③ resource itself, represented by the path

URL and URI differences:

(1) URI is a relatively broad concept, url is a kind of URI,

is a subset of the URI naming mechanism, which can be said to be abstract, and specifically to use URLs to locate resources.

(2) Every resource on the web, such as pictures, documents, videos, etc., is located by Uri, where the so-called positioning refers to the specific path on the server that the resources on the web are stored on the servers relative to the host server.

(3) A URL is a string used on the Internet to describe an information resource file, used on client programs and servers to locate a customer

Server, which not only locates this information resource, but also defines how to find the resource.

Popular Understanding:

URI is a resource positioning mechanism, it is relatively general positioning of resources, not limited to the client and server,

And the URL to locate all the resources on the Internet, as long as the resources on the Internet, there is a unique URL.

 A URI is a simple string that identifies a resource in a uniform (standardized) way.    Typically, this string begins with the scheme (the identifier of the namespace that names the URI-a set of related names), and the syntax is as follows:  [scheme:] scheme-specific-part  The URI begins with a scheme and a colon. Scheme starts with uppercase/lowercase letters, followed by empty or followed by more uppercase/lowercase letters, numbers, plus signs, minus and dot numbers. The colon separates scheme from Scheme-specific-part, and the syntax and semantics of scheme-specific-part (meaning) are determined by the namespace of the URI. As the following example:  HTTP://WWW.CNN shun Baidu. Shun Baidu com, where HTTP is scheme,//www.cnn shun Baidu. Shun Baidu com is scheme-specific-part, And its scheme is separated from the scheme-specific-part by a colon. The   URI has absolute and relative points, and the absolute URI refers to the URI that begins with scheme (followed by a colon). The aforementioned http://www.cnn shun Baidu. com is an example of an absolute URI, other examples and mailto:[email protected] avoid Baidu Avajeff shun Baidu. com, news shun Baidu: Comp.lang shun Baidu. Java.help and Xyz://whatever. You can think of an absolute URI as referencing a resource in a way that is not dependent on the environment in which the identifier appears. If you use the file system as an analogy, an absolute URI is similar to the path of a file starting from the root directory.   Unlike an absolute URI, a relative URI is not a URI that begins with scheme (followed by a colon). An example of this is articles/articles.html. You can think of a relative URI as referencing 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 words, URLs are strings used on the Internet to describe information resources, mainly used in various WWW client programs and server programs, especially the famous mosaic. URLs can be used to describe a variety of information resources in a uniform format, including files, server addresses, and directories.such as At present, the biggest disadvantage of   is that when the storage location of information resources changes, the URL must be changed accordingly. So people are looking at new ways of representing information resources, such as: URIs (Universal Resource Identifier) that is, "Common resource Identifiers", "Uniform Resource Names" and URC (Uniform Resource citation), which are "Uniform resource references" such as

The difference between a URL and a URI

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.