URL
A Uniform Resource Locator (URL) is a specific type of URI that provides the address of a resource and how to access it.
Without URLs, navigating the vast expanse of the internet would be nearly impossible.
Components of a URL
A URL is composed of several parts, each serving a specific function:
- Protocol : Specifies the method used to access the resource (e.g., HTTP , HTTPS , FTP).
- Domain Name : The human-readable address of the server hosting the resource (e.g., www.example.com).
- Path : Indicates the specific location of the resource on the server (e.g., /images/photo.jpg).
- Port (optional): Specifies the communication endpoint (e.g., :80 for HTTP, :443 for HTTPS).
- Query String (optional): Contains additional parameters for dynamic content (e.g., ?id=123).
- Fragment (optional): Points to a specific section within the resource (e.g., #section1).
Consider the URL: https://www.example.com:443/path/to/resource?id=123#section1:
- Protocol : https
- Domain Name : www.example.com
- Port : 443
- Path : /path/to/resource
- Query String : id=123
- Fragment : section1
How URLs Work
- When a user enters a URL into a web browser, the browser breaks it down into its components.
- The domain name is translated into an IP address using the Domain Name System (DNS).