Understanding URI, URL, and URN: The Core of Web Resource Identification
This article explains the definitions, relationships, and components of URI, URL, and URN, illustrating how they locate resources on the web, detailing protocol, domain, port, path, and filename rules, and providing references to the relevant RFC specifications.
URI, URL, URN Concepts
URI = Uniform Resource Identifier
URL = Uniform Resource Locator
URN = Uniform Resource Name
URI is an abstract identifier that can be expressed in various ways; if it can locate a resource, it is a URI. Historically two concrete methods were envisioned: URL for address‑based location and URN for name‑based location.
In practice URNs never gained wide adoption, so most URIs you encounter are URLs. The diagram below (originally from the source) shows the geometric relationship, confirming that a URL is a subset of a URI.
What a URL Is
A URL (Uniform Resource Locator) tells a client where a resource resides on the Web. The resource may be an HTML page, a CSS file, an image, a video, etc.
Protocol
The URL always begins with a scheme such as http, https, ftp, or mailto. The scheme determines which protocol the browser should use.
Username/Password
Credentials can be embedded (e.g., user:pass@) but are optional and often omitted.
Domain
The domain (e.g., www.gitee.com) is resolved via DNS to an IP address; if the IP is known, DNS lookup can be skipped.
Port
A port follows the domain after a colon ( :). It is optional; default ports are 80 for HTTP, 443 for HTTPS, and 21 for FTP.
Path and File Name
The path starts with the first slash after the domain and continues to the last slash before the file name. The file name may be followed by a query ( ?) or fragment ( #). If the file name is omitted, the server supplies a default file such as index.html or default.htm.
http://www.gitee.com/dir/ # trailing slash → directory, default file used
http://www.gitee.com # no trailing slash → root directory, default file used
http://www.gitee.com/yikoupeng # could be a file or a directory depending on serverWhen a directory path ends with a slash, the server looks for a default file (commonly index.html or default.htm) and serves it.
RFC Reference
The formal specifications for URLs are defined in RFC 3986 and related documents. They can be consulted at the RFC Editor site: https://www.rfc-editor.org/ Below is an excerpt from the RFC that defines the syntax and semantics of URLs.
Uniform Resource Locators (URL)
Status of this Memo
This document specifies an Internet standards track protocol for the
Internet community, and requests discussion and suggestions for
improvements. Please refer to the current edition of the "Internet
Official Protocol Standards" (STD 1) for the standardization state
and status of this protocol.
Abstract
This document specifies a Uniform Resource Locator (URL), the syntax
and semantics of formalized information for location and access of
resources via the Internet.The article concludes that understanding the structure of URIs, URLs, and URNs is essential for working with web resources, debugging network issues, and designing interoperable systems.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Liangxu Linux
Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
