Course එකට ආපසු

URLs Decoded

10 මිනිත්තු📖Lecture

🎯 පාඩමේ අරමුණු

මේ පාඩම ඉවර වෙද්දී ඔයාට:

  • URL එකක every part තේරුම් ගන්න පුළුවන් වෙයි
  • Click කරන්න කලින් URLs read කරලා expect කරන්න ඕන දේ දැනගන්න පුළුවන් වෙයි
  • Suspicious හෝ malformed URLs recognize කරන්න පුළුවන් වෙයි
  • URLs resources වලට map වෙන විදිය තේරුම් ගන්න පුළුවන් වෙයි

📖 URL එක කුමක්ද?

URL යනු Uniform Resource Locator.

Plain English වලින්

URL එකක් internet එකේ මොකක් හරි address එක.

ඔයාගේ home address එක mail carriers ට packages deliver කරන්න කොහේදැයි කියන එක වගේ, URL browser එකට specific webpage, image, file, resource find කරන්න කොහේදැයි කියනවා.


🔍 URL එකක Anatomy එක

Complete URL එකක් break down කරමු:

Text
https://www.example.com/shop/shoes?color=red&size=10#reviews
│ │ │ │ │ │ │
│ │ │ │ │ │ └─ Fragment
│ │ │ │ │ └─ Query Parameters
│ │ │ │ └─ Path (continued)
│ │ │ └─ Path
│ │ └─ Domain
│ └─ Subdomain
└─ Protocol

🔒 Protocol: https://

ඒක මොකක්ද:

Protocol browser එකට server එක එක්ක HOW communicate කරන්නද කියනවා.

Common Protocols:

ProtocolMeaningSecurity
https://HyperText Transfer Protocol Secure✅ Encrypted
http://HyperText Transfer Protocol❌ Encrypted නැහැ
ftp://File Transfer ProtocolFile downloads වලට
mailto:EmailEmail app open කරනවා

Security Tip

Sensitive information (passwords, credit cards) enter කරනකොට always https:// look කරන්න. 's' එකෙන් 'secure' — ඔයාගේ data encrypted.

Most browsers HTTPS sites වලට 🔒 padlock icon show කරනවා.


🏠 Domain: example.com

ඒක මොකක්ද:

Domain එක website එකේ name — restaurant එකේ name වගේ.

Examples:

  • google.com
  • youtube.com
  • amazon.com
  • github.com

Structure:

Text
example.com
│ │
│ └─ Top-Level Domain (TLD)
└─ Domain Name

Common TLDs:

TLDTypical Use
.comCommercial (most common)
.orgOrganizations
.eduEducational institutions
.govGovernment
.ioTech startups
.lkSri Lanka

🏢 Subdomain: www.

ඒක මොකක්ද:

Subdomain එක main domain එකේ section එකක් — company එකක department එක වගේ.

Examples:

  • www.example.com — www subdomain එකක් (traditional)
  • mail.google.com — Gmail service
  • docs.google.com — Google Docs
  • maps.google.com — Google Maps
  • blog.example.com — Company blog

Fun Fact

www just convention එකක්. example.com සහ www.example.com usually same place එකට point කරනවා.


📁 Path: /shop/shoes

ඒක මොකක්ද:

Path specify කරන්නේ WHICH page හෝ resource ඕනද — 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:

Text
Website/
├── about/
├── products/
│ ├── shoes/
│ │ └── nike/
│ └── shirts/
└── contact/

❓ Query Parameters: ?color=red&size=10

ඒක මොකක්ද:

Query parameters server එකට extra information send කරනවා — order එකක් එක්ක special instructions වගේ.

Structure:

Text
?key1=value1&key2=value2&key3=value3
│ │ │
│ │ └─ & multiple parameters separate කරනවා
│ └─ = key එක value එකට connect කරනවා
└─ ? query string start කරනවා

Examples:

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

ඒක මොකක්ද:

Fragment (anchor හෝ hash කියලත් කියනවා) browser එකට page එකේ specific section එකකට jump කරන්න කියනවා.

Examples:

example.com/article#introduction → Intro එකට jump example.com/article#chapter-2 → Chapter 2 ට jump example.com/article#conclusion → Conclusion එකට jump

Technical Note

Fragments completely browser handle කරනවා — ඒවා server එකට send වෙන්නේ නැහැ.


🔬 Practice කරමු: URL Breakdown

URL 1: YouTube Video

Text
https://www.youtube.com/watch?v=dQw4w9WgXcQ
PartValueMeaning
ProtocolhttpsSecure connection
SubdomainwwwStandard web
Domainyoutube.comYouTube website
Path/watchVideo watching page
Queryv=dQw4w9WgXcQPlay කරන Video ID

URL 2: Amazon Search

Text
https://www.amazon.com/s?k=laptop&ref=nb_sb_noss
PartValueMeaning
ProtocolhttpsSecure
Domainamazon.comAmazon
Path/sSearch page
Query klaptopSearch keyword
Query refnb_sb_nossTracking info

⚠️ Suspicious URLs Spot කිරීම

Watch කරන්න ඕන Red Flags

Suspicious PatternExampleBad ඇයි
Misspelled domainsgo0gle.com, amazom.comPhishing attempt
Extra subdomainslogin.google.secure.fakesite.comFake site
HTTP (HTTPS නෙමෙයි)http://yourbank.comInsecure connection
Domain වෙනුවට IP addresshttp://192.168.1.1/loginSuspicious
Very long, encoded URLs%2F%3D%26...Malicious content hide කරන්න පුළුවන්

Legitimate:

https://accounts.google.com/signin

Suspicious:

http://accounts.google.com.fake-login.com/signin ↑ Actually මේක fake-login.com!

🔐 URL Security Checklist

Sensitive Info Enter කරන්න කලින්:

0/4

✅ පාඩමේ සාරාංශය

URL PartSymbolPurposeExample
Protocol://Connect කරන විදියhttps://
Subdomaindomain ට කලින්Site sectionwww., mail.
Domain.com, .org, etc.Site identitygoogle.com
Path/කුමන page ද/search/images
Query? සහ &Extra parameters?q=cats&safe=on
Fragment#Page section#chapter-2

📝 Mini Quiz

📝 ඔයාගේ Understanding Check කරන්න

1/3

In https://www.youtube.com/watch?v=abc123, what is 'youtube.com'?