Translation The difference between a URL and a URI

Source: Internet
Author: User
Tags rfc

Translator: Hua Ke xiao tao: http://www.cnblogs.com/hust-ghtao/:

The beginning of the HTTP protocol, the two similar terms have been blindfolded, looked up a lot of information, finally made clear. (Find information or English ah, reliable ...) )。

This blog translation from: https://danielmiessler.com/study/url_vs_uri/, is a simple and practical good text, to help us understand the concept is very helpful:

President

There has been a lot of technical controversy, the most wonderful of which is probably the question of what the Web address should be called. This is usually the case: someone calls the contents of the Address bar "URL", and some people get a bit of a perk: "No!" In fact at that time URI ... ”

For this kind of corrective reaction, usually there are such a few cases, warn't small to think that this person hurriedly go, light fixed-point on the shrug of the agreed, the blow of the big temper, okay?

Then this article, just to provide a simple summary, after all, black and black to the point is it?

Uri,url,urn

As can be seen from the above picture, there are three different concepts Uri,url,urn. The best way to discuss such a problem is to go back to the point where we have collected some information in RFC 3986:uniform Resource Identifier (URI): Generic Syntax:

"A Uniform Resource Identifier (URI) is a compact string used to indicate abstract or physical resources. ”

"A URI can be further divided into locators, names, or both." The term "Uniform Resource Locator" (URL) is a subset of URIs that, in addition to identifying a resource, provides a primary access mechanism (such as its network "location") to locate the resource. “

That's what we all know about Wikipedia, which digests this piece well and describes it more vividly:

"URIs can be divided into Url,uri or one thing with locators and names characteristics at the same time. A URN acts like a person's name, and the URL is like a person's address. In other words: The urn determines the identity of the object, and the URL provides a way to find it. ”

We can get some conclusions from these descriptions:

    • First, the URL is one of the URIs (see it through that graph). So someone told you that the URL is not a URI, he is wrong. But not all URIs are URLs oh, like butterflies will fly, but will fly is not all butterflies ah, you let the flies think!
    • The "Access mechanism", "network location", is of course the URL where the URI can be made. e.g. http:// or.. ftp://
    • A urn is part of a unique identity and is a special name.
    1. Let's take a look at an example, when it comes to an RfC that comes from authority:
    • ftp://ftp.is.co.za/rfc/rfc1808.txt(also a URL because of the protocol)
    • http://www.ietf.org/rfc/rfc2396.txt(also a URL because of the protocol)
    • ldap://[2001:db8::7]/c=GB?objectClass?one(also a URL because of the protocol)
    • mailto:[email protected](also a URL because of the protocol)
    • news:comp.infosystems.www.servers.unix(also a URL because of the protocol)
    • tel:+1-816-555-1212
    • telnet://192.0.2.16:80/(also a URL because of the protocol)
    • urn:oasis:names:specification:docbook:dtd:xml:4.1.2

These are all URIs, some of which are URLs. What? is the ones that provide access mechanisms.

Summarize

Here's the time to answer the question:

When we replace the Web address, is the URI and URL that more accurate?

Based on the many articles I read, including the RfC, I would like to say that URIs are more accurate.

Don't worry, I have my reasons:

The URI that we often use is not a strictly technical URL. For example: The file you need is in the files.hp.com . This is the URI, but not the url--system may have a lot of protocols and ports to make positive

The correct response.

You go http://files.hp.com and ftp://files.hp.com . May get completely different content. This situation may be more common, think of different Google domain names on different services AH.

So, with a URI, you are usually technically correct, and the URL is not necessarily. Finally, the term "URL" is being deprecated. So be wise, boy!

Conclusion

If you don't mind being "this guy", the URIs are probably the more accurate term to use. But if you're in the linguist/"use of what ' s understood" camp, feel free to go with URL.

Translation 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.