Everything About URL
Everything About URL
What is a URL?
A URL tells the browser where and how to access a specific resource
(such as a webpage, image, or file) on the internet.
Structure of a URL:
1. Scheme (Protocol):
o Example: www.example.com.
3. Port (Optional):
o Example: :8080.
4. Path:
o Example: ?id=123&name=John.
6. Fragment (Optional):
o Begins with #.
o Example: #section2.
bash
Copy
https://www.example.com:443/about?id=123#section2
URL Types:
1. Absolute URL:
o Example: https://www.example.com/products?id=1.
2. Relative URL:
o Specifies a path relative to the current page or domain, often
used within a website.
URL Encoding:
Special Characters like &, ?, and =, are encoded for safe transfer in
query strings.