# Uniform Resource Locator (URL) A Uniform Resource Locator (URL) is a specific type of [[Uniform Resource Identifier (URI)]] that provides the *location* of a resource on the web. Invented by [[Tim Berners-Lee]] in 1994, URLs are the familiar web addresses typed into browsers. A URL specifies how to access a resource (the scheme/protocol), where it lives (host), and what to retrieve (path). URLs are a subset of URIs—all URLs are URIs, but URIs also include URNs which identify by name rather than location. ## URL Structure ``` https://www.example.com:443/path/to/page.html?id=123&sort=asc#section2 └─┬──┘ └───────┬───────┘└┬┘└───────┬────────┘└───────┬──────┘└───┬───┘ Scheme Host Port Path Query Fragment ``` | Component | Description | Example | |-----------|-------------|---------| | **Scheme** | Protocol to use | `https`, `ftp`, `mailto` | | **Host** | Server address | `www.example.com` | | **Port** | Network port (often implicit) | `:443` (HTTPS default) | | **Path** | Resource location on server | `/path/to/page.html` | | **Query** | Parameters (key=value pairs) | `?id=123&sort=asc` | | **Fragment** | Section within resource | `#section2` | ## Common URL Schemes | Scheme | Purpose | Example | |--------|---------|---------| | `http` | Web (unencrypted) | `http://example.com` | | `https` | Web (encrypted) | `https://example.com` | | `ftp` | File transfer | `ftp://files.example.com` | | `mailto` | Email address | `mailto:[email protected]` | | `file` | Local file | `file:///path/to/file` | | `tel` | Phone number | `tel:+1-555-123-4567` | ## References - RFC 1738: Uniform Resource Locators (URL) - RFC 3986: URI Generic Syntax - https://en.wikipedia.org/wiki/URL ## Related - [[Uniform Resource Identifier (URI)]] - [[World Wide Web]] - [[Tim Berners-Lee]] - [[Hypertext Transfer Protocol (HTTP)]] - [[Internet]]