🧑🏫 What is a URL?
A URL (Uniform Resource Locator) is the full address of a web page, like a street address for websites. It tells your browser where to go.
https:// → protocol
www.example.com → hostname
:8080 → port (optional)
/path/to/page → pathname
?query=123 → search (optional)
#top → fragment (optional)
Quick Examples by Category:
🧠 URL Components & Explanations
Protocol (Scheme):
How the browser connects to the site (e.g., http, https).
Host:
Includes domain name + port (e.g., www.example.com:443).
Hostname:
Just the domain name (e.g., www.example.com).
Port:
Specifies which server port to connect to. Common ports: 80 (HTTP), 443 (HTTPS).
Pathname:
Tells the server which resource or file is being requested (e.g., /products/page1).
Search Query:
Sends extra info using key=value pairs (starts with ?).
Fragment (Hash):
Scrolls to a specific section of the page (starts with #).