The relationship and difference between URL, URI and URN

The relationship and difference between URL, URI and URN

URL

Uniform Resource Locator (URL) is a reference to a resource and a method of accessing it. It is commonly known as the URL, which is in the address bar of the browser.

A URL consists of the following different parts:

  • Protocol: usually https or http, a method of telling the browser or device how to access resources. Of course, there are other protocols, such as ftp, mailto, etc.
  • Next is ://
  • Hostname: A registered name (domain name) or IP address that represents an IP address, a numeric identifier used to identify a device connected to a network.
  • The port number, preceded by a colon:
  • Path: can refer to a file system path, usually used as a code segment
  • Parameters: optional query parameters starting with a question mark, where multiple parameters are connected with &
  • Hash: used to provide quick links to titles on a page, such as anchor links

URI

Similar to URL, Uniform Resource Identifier (URI) provides a method to identify resources. However, unlike URL, URI does not provide a method to locate the resource.

The most common form of URI is the Uniform Resource Locator (URL), often specified informally as a web address. From this, it can be seen that URI is a superset of URL, and every URL is essentially a URI.

URN

Uniform Resource Name (URN) is the historical name of Uniform Resource Identifier (URI), and URN is used as the URI scheme.

From the perspective of a set, URN and URL are both subsets of URI, as shown in the figure:

Taking a website as an example, the following clearly shows the contents of URI, URN, and URL, which can more intuitively reflect the relationship between the three:

To conceptually summarize the relationship between the three, as shown in the figure:

picture

<<:  Get started quickly and build a personalized Python GUI calculator in five minutes

>>:  Several steps and tools for troubleshooting the network

Recommend

Common WiFi Attacks and Detection

Common WiFi attacks under the 802.11 standard Tra...

Step-by-step analysis: How to write a data analysis report?

[51CTO.com Quick Translation] As a data analyst, ...

EDA event-driven architecture and EventBridge

Today's more successful companies have realiz...

JD.com's Lv Jianwei: Black technology leads the new era of e-commerce

[51CTO.com original article] On July 21-22, 2017,...

By 2026, the Wi-Fi 6 and 6E market in Asia Pacific will reach US$8.559 billion

On March 26, according to foreign media reports, ...

The future of 5G technology: a world of infinite possibilities

The tech world is abuzz with something really exc...

Can the United States make China disappear from the Internet?

Let’s talk about an interesting topic today. Ther...

No wonder 4G is faster than 5G now. The secrets of 4G you don’t know

I don’t know if you have noticed that it is obvio...

Analysis of the Four Major Disaster Recovery Technologies in Data Centers

Disaster recovery technology means that when a da...

If you only focus on speed when developing 5G, your vision is a bit narrow

This article is reprinted with permission from AI...

Five technology trends everyone must prepare for in 2024

Machine intelligence, the blurring of the lines b...

Problems that edge computing needs to solve urgently

At present, edge computing has been widely recogn...