A Uniform Resource Locator (URL) is a Uniform Resource Identifier (URI) that specifies where a particular resource is available – and the mechanism for retrieving it. They are often informally referred to as web addresses.
A Uniform Resource Locator (URL) is a specific type of Uniform Resource Identifier (URI) that specifies where an identified resource is available – and the mechanism for retrieving it. In popular usage, URLs are often incorrectly regarded as being the same as URIs; the other type of URI is the less common Uniform Resource Name (URN).
The best-known example of a URL is for the addresses of web pages on the World Wide Web, such as
http://www.example.com/ and URLs are commonly informally referred to as web addresses.
The structure of all URIs (both locators and names) is:
- The scheme specifies the mechanism (or protocol) for retrieving the resource, e.g.,
- The authority part consists of an optional authentication section (username and password), followed by a host (which may be expressed as a hostname or IP address) with an optional port number if non-standard ports are used.
- The path is similar to a filesystem path (and may map to one).
- There may be an optional query string of data (usually specified as name-value pairs separated by an ampersand,
- The final part (after
#) is called the fragment; this can be used to specify a secondary resource within a document, e.g., a section heading.
On Unix systems, the curl command is commonly used to work with URLs.