A Uniform Resource Locator (URL) is a specific type of Uniform Resource Identifier (URI) that is used to specify the address of a resource on the internet. It provides the means to access various resources, such as web pages, images, videos, and files.
A typical URL consists of several components:
- Scheme: Indicates the protocol used to access the resource (e.g.,
http
,https
,ftp
). - Host: The domain name or IP address of the server where the resource is located.
- Port (optional): The port number on the server (e.g.,
:80
for HTTP,:443
for HTTPS). - Path: The specific location of the resource on the server.
- Query (optional): A set of parameters passed to the resource (usually starts with
?
). - Fragment (optional): A specific section within the resource (usually starts with
#
).
Example of a URL
Here's a breakdown of an example URL:
https://www.example.com:443/path/to/resource?query=parameter#section
- Scheme:
https
- Host:
www.example.com
- Port:
443
(default for HTTPS, often omitted) - Path:
/path/to/resource
- Query:
query=parameter
- Fragment:
#section
In this example, the URL points to a resource located at www.example.com
using the HTTPS protocol, with additional parameters and a specific section of the resource being accessed.