Difference between revisions of "URL"

From Pulsed Media Wiki
(Created page with "== URL == A '''URL''' (an acronym for '''Uniform Resource Locator''') is a standardized text string that specifies how to access a resource on the Internet...")
 
(Guides: Information: PulsedMedia: Pulsed Media)
 
Line 1: Line 1:
 
== URL ==
 
== URL ==
  
A '''[[URL]]''' (an acronym for '''Uniform Resource Locator''') is a standardized text string that specifies how to access a [[Resource|resource]] on the [[Internet]]. It is the most common form of [[Uniform Resource Identifier|URI]] and is primarily used to identify the location of [[Web page|web pages]], images, files, and other data on the [[World Wide Web]].
+
A '''URL''' (Uniform Resource Locator) is a standardized text string that shows how to access a resource on the internet. It's the most common type of URI (Uniform Resource Identifier), mainly used to locate web pages, images, files, and other data on the World Wide Web.
  
Essentially, a [[URL]] is an address that tells a [[Web browser|web browser]] or other [[Client (computing)|client]] exactly where to find something on a network and what [[Protocol|protocol]] to use to retrieve it.
+
In simple terms, a URL is an address that tells your web browser exactly where to find something online and what method (protocol) to use to get it.
  
 
=== Structure of a URL ===
 
=== Structure of a URL ===
  
A [[URL]] is composed of several parts, though not all parts are always present in every [[URL]]. The general structure can be broken down as follows:
+
A URL has several parts, though not all are always present. Its general structure is: scheme://authority/path?query#fragment Here's what each part means:
 
 
`scheme://authority/path?query#fragment`
 
 
 
Let's break down the main components:
 
 
 
* '''[[Scheme (URL)|Scheme]]:''' This is the first part of the [[URL]] and specifies the [[Protocol|protocol]] to be used to access the resource. It is followed by a colon (`:`). Common schemes for the web include `[[Hypertext Transfer Protocol|http]]` and `[[HTTPS|https]]` (for secure web traffic), but other schemes like `[[File Transfer Protocol|ftp]]` (for file transfer), `mailto` (for email addresses), or `file` (for local files) also exist.
 
 
 
* '''Authority:''' This part is typically preceded by a double slash (`//`) and specifies the location of the server or host where the resource is located. It can itself be broken down into sub-components:
 
    * `[userinfo@]` (Optional): Contains a username and optional password separated by a colon (`:`), followed by an "at" symbol (`@`). This is rarely used in modern web URLs due to security concerns.
 
    * '''[[Hostname|Host]]:''' The [[Domain Name System|domain name]] (e.g., `www.example.com`) or [[IP address]] (e.g., `192.168.1.1`) of the [[Web server]] or other host providing the resource. The [[Web browser|browser]] uses the [[Domain Name System|DNS]] to translate a [[Hostname|hostname]] into an [[IP address]].
 
    * `[:port]` (Optional): The [[Port (computer networking)|port]] number on the host to which the client should connect. If omitted, the default port for the specified [[Scheme (URL)|scheme]] is used (e.g., 80 for [[HTTP]], 443 for [[HTTPS]]).
 
 
 
* '''[[Path (computing)|Path]]:''' This part identifies the specific resource within the host. It consists of a sequence of path segments separated by slashes (`/`), similar to directories and file names in a [[File system|file system]] path. It indicates the location of the resource on the server.
 
 
 
* '''[[Query string|Query]]:''' This optional part is preceded by a question mark (`?`) and contains data to be passed to the server, often for dynamic resources. It consists of key-value pairs separated by ampersands (`&`) (e.g., `?search=test&category=web`). The server-side script can access and use this data to generate the response.
 
 
 
* '''[[Fragment identifier|Fragment]]:''' This optional part is preceded by a hash symbol (`#`) and specifies a secondary resource or a portion of the primary resource. On [[Web page|web pages]], it is often used to link to a specific section within an [[HTML]] document (using the ID attribute of an element). The [[Fragment identifier|fragment]] is processed by the [[Web browser|browser]] and is typically not sent to the [[Web server]].
 
  
 +
'''Scheme:''' The first part, followed by a colon (:), indicating the protocol to use (e.g., http, https for web, ftp for file transfer, mailto for email).
 +
'''Authority:''' Usually comes after // and specifies the server or host. It includes:
 +
[userinfo@] (Optional): Username and password (rarely used now).
 +
'''Host:''' The domain name (e.g., www.example.com) or IP address of the server. Your browser uses DNS to find the IP address.
 +
[:port] (Optional): The port number to connect to (e.g., 80 for HTTP, 443 for HTTPS, if not specified).
 +
'''Path:''' Identifies the specific resource on the host, using slashes (/) like folders and file names in a file system.
 +
'''Query:''' An optional part, starting with ?, containing data for the server, often for dynamic content. It uses key-value pairs separated by & (e.g., ?item=shoes&color=blue).
 +
'''Fragment:''' An optional part, starting with #, that points to a specific section within the resource (like a section on a web page). Your browser processes this; it's not sent to the server.
 
=== Examples ===
 
=== Examples ===
  
Let's look at a few examples to illustrate the components:
+
Let's look at a few examples:
  
`https://www.example.com:8080/path/to/resource.html?query=value#section`
+
https://www.example.com:8080/path/to/resource.html?query=value#section
  
* **Scheme:** `https`
+
Scheme: https
* **Authority:** `www.example.com:8080`
+
Authority: www.example.com:8080
    * **Host:** `www.example.com`
+
Host: www.example.com
    * **Port:** `8080`
+
Port: 8080
* **Path:** `/path/to/resource.html`
+
Path: /path/to/resource.html
* **Query:** `query=value`
+
Query: query=value
* **Fragment:** `section`
+
Fragment: section
 +
ftp://user:password@ftp.example.com/public/file.txt
  
`ftp://user:password@ftp.example.com/public/file.txt`
+
Scheme: ftp
 
+
Authority: user:password@ftp.example.com
* **Scheme:** `ftp`
+
Userinfo: user:password
* **Authority:** `user:password@ftp.example.com`
+
Host: ftp.example.com
    * **Userinfo:** `user:password`
+
Path: /public/file.txt
    * **Host:** `ftp.example.com`
+
mailto:user@example.com
* **Path:** `/public/file.txt`
 
 
 
`mailto:user@example.com`
 
 
 
* **Scheme:** `mailto`
 
* **Authority:** (None in this scheme)
 
* **Path:** `user@example.com` (The structure varies by scheme)
 
  
 +
Scheme: mailto
 +
Path: user@example.com (Note: structure varies by scheme)
 
=== Relation to URIs and URNs ===
 
=== Relation to URIs and URNs ===
  
A [[URL]] is a type of [[Uniform Resource Identifier|URI]]. The term [[Uniform Resource Identifier|URI]] is a more general concept that encompasses both URLs (which specify location) and URNs (Uniform Resource Names), which specify a resource by name without necessarily indicating its location (like an [[ISBN]] for a book). All URLs are URIs, but not all URIs are URLs. However, in common usage, "URL" is often used generically to refer to URIs, especially web addresses.
+
A URL is a type of URI (Uniform Resource Identifier). URI is a broader term covering URLs (which tell where a resource is) and URNs (which name a resource, like an ISBN, without saying where it is). So, all URLs are URIs, but not all URIs are URLs. Still, 'URL' is often used generally for web addresses.
  
 
=== Encoding ===
 
=== Encoding ===
  
[https://en.wikipedia.org/wiki/Character_encoding], also known as percent-encoding, is a mechanism for encoding information in a [[URL]] under certain circumstances. It is used to represent characters that are not allowed in a [[URL]] (like spaces or certain symbols) or characters that have special meaning within a [[URL]]'s structure (like `?`, `#`, `/`, `&`, `=`, `:`, `;`, `+`, `,`, `@`, ` `). These characters are replaced by a percent sign (`%`) followed by their two-digit [[Hexadecimal]] representation. For example, a space character is encoded as `%20`. This encoding primarily applies to characters within the path, query, and fragment components.
+
URL encoding, or percent-encoding, is how special characters (like spaces or ?, #) that aren't allowed or have special meaning in a URL are represented. These characters are replaced by a percent sign (%) followed by their two-digit hexadecimal code (e.g., a space becomes %20). This mostly applies to characters in the path, query, and fragment.
  
 
=== See Also ===
 
=== See Also ===
  
* [[Uniform Resource Identifier|URI]]
+
[[DNS]]
* [[World Wide Web]]
 
* [[Hypertext Transfer Protocol|HTTP]]
 
* [[Domain Name System|DNS]]
 
* [[Web server]]
 
* [[Protocol]]
 
* [[Hostname]]
 
* [[IP address]]
 
* [[Port (computer networking)]]
 
* [https://en.wikipedia.org/wiki/Character_encoding]
 
* [[Resource]]
 
 
 
=== References ===
 
  
* {{cite book |last=Berners-Lee |first=Tim |title=Weaving the Web: The Original Design and Ultimate Destiny of the World Wide Web by its Inventor |publisher=HarperCollins |year=1999 |isbn=0-06-251587-X}} - By the inventor of the WWW, URLs, HTTP, etc.
 
* {{cite book |last=Jacobs |first=Ian |title=The World Wide Web, Past, Present and Future |publisher=Springer |year=2001 |isbn=3-540-42467-1}} - Overview of web standards, including URLs.
 
* [https://datatracker.ietf.org/doc/html/rfc3986 RFC 3986: Uniform Resource Identifier (URI): Generic Syntax] - The official technical specification document defining URI syntax, which includes URLs.
 
* [https://developer.mozilla.org/en-US/docs/Web/API/URL MDN Web Docs - URL] - Provides a clear explanation and breakdown of URL components.
 
* [https://www.cloudflare.com/learning/urls/what-is-a-url/ Cloudflare - What is a URL?] - An online resource explaining URLs for a general audience.
 
  
[[Category:URLs]]
+
[[Category:Information]]
[[Category:World Wide Web]]
+
[[Category:Guides]]
[[Category:Internet protocols]]
 
[[Category:Resource identification]]
 
[[Category:Computer network architecture]]
 

Latest revision as of 10:57, 27 May 2025

URL

A URL (Uniform Resource Locator) is a standardized text string that shows how to access a resource on the internet. It's the most common type of URI (Uniform Resource Identifier), mainly used to locate web pages, images, files, and other data on the World Wide Web.

In simple terms, a URL is an address that tells your web browser exactly where to find something online and what method (protocol) to use to get it.

Structure of a URL

A URL has several parts, though not all are always present. Its general structure is: scheme://authority/path?query#fragment Here's what each part means:

Scheme: The first part, followed by a colon (:), indicating the protocol to use (e.g., http, https for web, ftp for file transfer, mailto for email). Authority: Usually comes after // and specifies the server or host. It includes: [userinfo@] (Optional): Username and password (rarely used now). Host: The domain name (e.g., www.example.com) or IP address of the server. Your browser uses DNS to find the IP address. [:port] (Optional): The port number to connect to (e.g., 80 for HTTP, 443 for HTTPS, if not specified). Path: Identifies the specific resource on the host, using slashes (/) like folders and file names in a file system. Query: An optional part, starting with ?, containing data for the server, often for dynamic content. It uses key-value pairs separated by & (e.g., ?item=shoes&color=blue). Fragment: An optional part, starting with #, that points to a specific section within the resource (like a section on a web page). Your browser processes this; it's not sent to the server.

Examples

Let's look at a few examples:

https://www.example.com:8080/path/to/resource.html?query=value#section

Scheme: https Authority: www.example.com:8080 Host: www.example.com Port: 8080 Path: /path/to/resource.html Query: query=value Fragment: section ftp://user:password@ftp.example.com/public/file.txt

Scheme: ftp Authority: user:password@ftp.example.com Userinfo: user:password Host: ftp.example.com Path: /public/file.txt mailto:user@example.com

Scheme: mailto Path: user@example.com (Note: structure varies by scheme)

Relation to URIs and URNs

A URL is a type of URI (Uniform Resource Identifier). URI is a broader term covering URLs (which tell where a resource is) and URNs (which name a resource, like an ISBN, without saying where it is). So, all URLs are URIs, but not all URIs are URLs. Still, 'URL' is often used generally for web addresses.

Encoding

URL encoding, or percent-encoding, is how special characters (like spaces or ?, #) that aren't allowed or have special meaning in a URL are represented. These characters are replaced by a percent sign (%) followed by their two-digit hexadecimal code (e.g., a space becomes %20). This mostly applies to characters in the path, query, and fragment.

See Also

DNS