🎯 Lesson Objectives
By the end of this lesson, you will:
- Understand every part of a URL
- Read URLs and know what to expect before clicking
- Recognize suspicious or malformed URLs
- Understand how URLs map to resources
📖 What is a URL?
URL stands for Uniform Resource Locator.
In Plain English
A URL is the address of something on the internet.
Just like your home address tells mail carriers where to deliver packages, a URL tells browsers where to find a specific webpage, image, file, or resource.
🔍 Anatomy of a URL
Let's break down a complete URL:
https://www.example.com/shop/shoes?color=red&size=10#reviews│ │ │ │ │ │ ││ │ │ │ │ │ └─ Fragment│ │ │ │ │ └─ Query Parameters│ │ │ │ └─ Path (continued)│ │ │ └─ Path│ │ └─ Domain│ └─ Subdomain└─ Protocol🔒 Protocol: https://
What It Is:
The protocol tells your browser HOW to communicate with the server.
Common Protocols:
| Protocol | Meaning | Security |
|---|---|---|
https:// | HyperText Transfer Protocol Secure | ✅ Encrypted |
http:// | HyperText Transfer Protocol | ❌ Not encrypted |
ftp:// | File Transfer Protocol | For file downloads |
mailto: | Opens email app |
Security Tip
Always look for https:// when entering sensitive information (passwords, credit cards). The 's' means 'secure' — your data is encrypted.
Most browsers show a 🔒 padlock icon for HTTPS sites.
🏠 Domain: example.com
What It Is:
The domain is the name of the website — like the restaurant's name.
Examples:
google.comyoutube.comamazon.comgithub.com
Structure:
example.com │ │ │ └─ Top-Level Domain (TLD) └─ Domain NameCommon TLDs:
| TLD | Typical Use |
|---|---|
.com | Commercial (most common) |
.org | Organizations |
.edu | Educational institutions |
.gov | Government |
.io | Tech startups |
.net | Network services |
.co.uk | United Kingdom |
🏢 Subdomain: www.
What It Is:
A subdomain is a section of the main domain — like a department within a company.
Examples:
www.example.com— www is a subdomain (traditional)mail.google.com— Gmail servicedocs.google.com— Google Docsmaps.google.com— Google Mapsblog.example.com— A company's blog
Fun Fact
www is just a convention. example.com and www.example.com usually point to the same place.
📁 Path: /shop/shoes
What It Is:
The path specifies WHICH page or resource you want — like a folder structure.
Examples:
example.com/ → Home page
example.com/about → About page
example.com/products → Products page
example.com/products/shoes → Shoes category
example.com/products/shoes/nike → Nike shoes specifically
Folder Analogy:
Website/├── about/├── products/│ ├── shoes/│ │ └── nike/│ └── shirts/└── contact/❓ Query Parameters: ?color=red&size=10
What It Is:
Query parameters send extra information to the server — like special instructions with your order.
Structure:
?key1=value1&key2=value2&key3=value3 │ │ │ │ │ └─ & separates multiple parameters │ └─ = connects key to value └─ ? starts the query stringExamples:
google.com/search?q=cats
└─ q (query) = cats
youtube.com/watch?v=abc123
└─ v (video) = abc123
amazon.com/products?category=electronics&sort=price
└─ Multiple parameters
Common Uses:
- Search queries (
?q=search+term) - Filters (
?color=blue&size=large) - Sorting (
?sort=price&order=asc) - Pagination (
?page=2)
🎯 Fragment: #reviews
What It Is:
The fragment (also called anchor or hash) tells the browser to jump to a specific section of the page.
Examples:
example.com/article#introduction → Jump to intro
example.com/article#chapter-2 → Jump to chapter 2
example.com/article#conclusion → Jump to conclusion
Technical Note
Fragments are handled entirely by the browser — they're NOT sent to the server.
🔬 Let's Practice: URL Breakdown
URL 1: YouTube Video
https://www.youtube.com/watch?v=dQw4w9WgXcQ| Part | Value | Meaning |
|---|---|---|
| Protocol | https | Secure connection |
| Subdomain | www | Standard web |
| Domain | youtube.com | YouTube's website |
| Path | /watch | Video watching page |
| Query | v=dQw4w9WgXcQ | Video ID to play |
URL 2: Amazon Search
https://www.amazon.com/s?k=laptop&ref=nb_sb_noss| Part | Value | Meaning |
|---|---|---|
| Protocol | https | Secure |
| Domain | amazon.com | Amazon |
| Path | /s | Search page |
Query k | laptop | Search keyword |
Query ref | nb_sb_noss | Tracking info |
⚠️ Spotting Suspicious URLs
Red Flags to Watch For
| Suspicious Pattern | Example | Why It's Bad |
|---|---|---|
| Misspelled domains | go0gle.com, amazom.com | Phishing attempt |
| Extra subdomains | login.google.secure.fakesite.com | Fake site |
| HTTP (not HTTPS) | http://yourbank.com | Insecure connection |
| IP address instead of domain | http://192.168.1.1/login | Suspicious |
| Very long, encoded URLs | %2F%3D%26... | May hide malicious content |
Legitimate:
https://accounts.google.com/signin
Suspicious:
http://accounts.google.com.fake-login.com/signin
↑
This is actually fake-login.com!
🔐 URL Security Checklist
✅ Before Entering Sensitive Info:
0/4✅ Lesson Summary
| URL Part | Symbol | Purpose | Example |
|---|---|---|---|
| Protocol | :// | How to connect | https:// |
| Subdomain | before domain | Site section | www., mail. |
| Domain | .com, .org, etc. | Site identity | google.com |
| Path | / | Which page | /search/images |
| Query | ? and & | Extra parameters | ?q=cats&safe=on |
| Fragment | # | Page section | #chapter-2 |
📝 Mini Quiz
📝 Check Your Understanding
1/3In https://www.youtube.com/watch?v=abc123, what is 'youtube.com'?