Table of Contents

    URL

    URL
    Figure: URL

    WEB FUNDAMENTALS

    URL — Uniform Resource Locator

    A URL (Uniform Resource Locator) is the address of any resource on the Internet. Every webpage, image, video, or file has a unique URL that tells the browser exactly where to find it. Understanding URLs is essential for navigating, sharing, and building the web.

    Introduction

    Every time you visit a website, click a link, or share a page — you're using a URL (Uniform Resource Locator). URLs are the addresses that make the Internet navigable.

    In this article, we'll explore what a URL is, all its parts, common examples, rules for validity, and why URLs are so important. By the end, you'll be able to read and understand any URL you encounter on the web.

    Key Idea: A URL is the unique address that helps your browser find the right resource on the Internet.

    Real-Life Analogy

    A URL is like a street address. Just as a postal address (123 Main Street, City, ZIP) tells the mailman exactly where to deliver a letter, a URL tells the browser exactly where to find a webpage or file on the Internet.

    What is a URL?

    A URL (Uniform Resource Locator) is the unique address used to locate a resource on the Internet — such as a webpage, image, video, or file.

    1

    Unique Address

    One-of-a-kind identifier

    Every resource on the Internet has a unique URL. No two resources share the same URL.

    2

    Locates a Resource

    Points to specific content

    Whether it's a webpage, image, PDF, or video, the URL points to its exact location.

    3

    Used by Browsers

    Guides web navigation

    Web browsers use URLs to request resources from servers and load them in the browser window.

    Key Points About URLs

    Important Facts

    • ✓ A URL tells the browser where to find a resource.
    • ✓ Every webpage has a unique URL.
    • ✓ URLs are not case-sensitive for the domain part (www.Example.com = www.example.com). Note: paths after the domain CAN be case-sensitive.
    • ✓ URLs are used by browsers to request resources from servers.
    • ✓ URLs follow a specific syntax (structure or format).
    • ✓ URLs can be typed manually or clicked as links.
    • ✓ URLs are the foundation of how the web works.
    • ✓ URLs are used in APIs, apps, and many other services.

    Example of URL — Complete Breakdown

    Let's look at a real URL and break it down into all its parts:

    EXAMPLE URL
    https://www.example.com:8080/path/page.html?name=abc&id=123#top

    This URL contains all 10 possible parts of a URL. Let's understand each one.

    Parts of a URL

    A URL is made up of up to 10 parts, each serving a specific purpose.

    # Part Example Description
    1 Protocol (Scheme) https:// The protocol used to access the resource (http, https, ftp).
    2 Subdomain www Optional part that specifies a subdomain (www, mail, blog).
    3 Domain Name example The main domain name of the website.
    4 Top-Level Domain (TLD) .com The last part of the domain name (.com, .org, .net, .edu, .in).
    5 Port :8080 Optional part that specifies the port. Default: 80 for http, 443 for https.
    6 Path /path/page.html The path to the specific resource on the server.
    7 Query String ?name=abc&id=123 Optional parameters sent to the server.
    8 Fragment (Anchor) #top Points to a specific part within the resource.
    9 Parameters name=abc, id=123 Key-value pairs in the query string.
    10 Separator ? , & , # , : , / Special characters used to separate parts.

    1. Protocol (Scheme)

    1

    Protocol (Scheme)

    How to access the resource

    The protocol defines how the browser communicates with the server.

    Common Protocols
    • http:// — Standard, unencrypted
    • https:// — Secure, encrypted (SSL/TLS)
    • ftp:// — File Transfer Protocol
    • mailto: — Email addresses
    • file:// — Local files

    2. Subdomain

    2

    Subdomain

    Optional prefix

    A subdomain is a division of the main domain, often used to separate different services or sections of a website.

    Examples
    • www.example.com — Traditional web
    • mail.example.com — Email service
    • blog.example.com — Blog section
    • shop.example.com — Online store

    3. Domain Name

    3

    Domain Name

    The main website name

    The domain name is the primary identifier of a website. It's unique and registered through a domain registrar.

    Examples google, facebook, wikipedia, amazon

    4. Top-Level Domain (TLD)

    4

    Top-Level Domain (TLD)

    Domain extension

    The TLD is the last part of the domain, indicating the type or origin of the website.

    TLD Meaning
    .com Commercial (most common)
    .org Organization (non-profit)
    .net Network services
    .edu Educational institution
    .gov Government
    .in India (country code)
    .uk United Kingdom
    .io Popular for tech startups

    5. Port

    5

    Port

    Communication channel

    The port number specifies which network service to communicate with. Optional in most cases.

    Default Ports
    • HTTP → Port 80
    • HTTPS → Port 443
    • FTP → Port 21
    • SSH → Port 22

    6. Path

    6

    Path

    Location on server

    The path specifies the exact location of the resource on the server, like folders and file names.

    Examples
    • /about
    • /blog/post-1.html
    • /products/electronics/phones

    7. Query String

    7

    Query String

    Additional data

    Starts with ? and passes additional data to the server. Multiple parameters separated by &.

    Examples
    • ?q=computer — Search query
    • ?page=2&sort=price — Pagination
    • ?user=john&lang=en — User settings

    8. Fragment (Anchor)

    8

    Fragment (Anchor)

    Section within the page

    Starts with # and points to a specific section within the webpage. Handled by the browser, not sent to server.

    Examples
    • #top — Top of page
    • #section2 — Section 2
    • #contact — Contact section

    9. Parameters

    9

    Parameters

    Key-value pairs

    Parameters are the key-value pairs inside the query string. Each pair consists of a name and value.

    Format key=value. Multiple pairs joined by &.

    10. Separator

    10

    Separator

    Special characters

    Special characters used to separate the different parts of a URL.

    Separator Meaning
    :// Separates protocol from the rest
    . Separates subdomain, domain, TLD
    : Before port number
    / Separates path segments
    ? Starts query string
    & Separates query parameters
    # Starts fragment

    Common Examples of URLs

    URL Description
    https://www.google.com Homepage of Google
    http://example.com/about About page of example.com
    https://mail.example.com:993/inbox Mail inbox on port 993
    https://www.example.com/search?q=computer Search results for "computer"
    https://www.example.com/page.html#section2 Go to section2 in page.html
    ftp://files.example.com/documents.zip Download file via FTP
    mailto:user@example.com Compose new email

    Rules for a Valid URL

    Validity Rules

    • Must start with a valid protocol (http:// or https://).
    • Domain name must be valid and registered.
    • No spaces are allowed (use %20 for encoded space).
    • Use special characters in correct format (?, &, #, :, /).
    • URLs are case-insensitive for the domain part.
    • Length has a practical limit (usually 2048 characters).
    • Only URL-safe characters should be used.
    • Special characters may need URL encoding.

    URL Encoding

    Some characters are not safe in URLs. They must be encoded using % followed by their hexadecimal code.

    Character Encoded As
    Space %20 or +
    ! %21
    # %23
    & %26
    = %3D
    ? %3F
    / %2F

    Importance of URL

    Why URLs Matter

    • Address of any resource on the Internet
    • Helps browsers locate and load correct content
    • Essential for web navigation
    • Used for sharing links and bookmarks
    • Foundation of APIs and web services
    • Enables search engines to index the web
    • Powers deep linking to specific content

    Where URLs Are Used

    • Web browsers (address bar)
    • Email hyperlinks
    • Social media posts
    • QR codes
    • APIs and web services
    • Mobile applications
    • Print media (books, ads)

    URL Security

    Security Tips

    • Always check for HTTPS on sensitive websites.
    • Look for the padlock icon in the browser.
    • Beware of phishing URLs that look similar to real ones.
    • Don't click suspicious links in emails or messages.
    • Check the domain name carefully — paypaI.com is different from paypal.com.
    • Use URL preview tools to inspect shortened links.
    • Verify URLs before entering personal information.
    • Never share sensitive info via unencrypted (http) URLs.

    URL Shortening

    URL Shortening converts long URLs into short, memorable ones — helpful for sharing on social media, texts, or print.

    Popular URL Shorteners
    • bit.ly — Bitly
    • tinyurl.com — TinyURL
    • goo.gl — Google (discontinued)
    • t.co — Twitter/X

    Did You Know?

    Interesting Fact

    The longest URL ever was over 2 million characters long — created for testing purposes! While browsers theoretically support very long URLs, most practical URLs are kept under 2,048 characters for compatibility. The first URL ever created by Tim Berners-Lee was http://info.cern.ch/.

    Frequently Asked Questions

    Q1. What is a URL?

    A URL (Uniform Resource Locator) is the unique address of a resource on the Internet — like a webpage, image, or file.

    Q2. What's the difference between URL and web address?

    They are the same. A URL is a technical name for a web address.

    Q3. What's the difference between HTTP and HTTPS?

    HTTP is the standard protocol. HTTPS is the secure version that encrypts data using SSL/TLS.

    Q4. Are URLs case-sensitive?

    The domain part is not case-sensitive (Google.com = google.com). However, the path part can be case-sensitive depending on the server (Linux servers usually are; Windows servers usually aren't).

    Q5. What is a domain name?

    A domain name is the human-friendly name of a website (like google.com) that maps to an IP address behind the scenes.

    Q6. What is a TLD?

    TLD stands for Top-Level Domain — the last part of a domain name like .com, .org, .edu.

    Q7. What is URL encoding?

    URL encoding converts unsafe characters (like spaces) into a format that can be safely transmitted in a URL (e.g., space becomes %20).

    Q8. Can a URL contain spaces?

    No! Spaces are not allowed in URLs. They must be encoded as %20 or replaced with +.

    Q9. What is the maximum length of a URL?

    Technically unlimited, but browsers typically support URLs up to 2,048 characters for practical purposes.

    Q10. What is a query string?

    A query string is the part of a URL that starts with ? and contains parameters sent to the server, like search terms or filters.

    Key Takeaways

    • A URL is the unique address of any Internet resource.
    • Contains up to 10 parts: protocol, subdomain, domain, TLD, port, path, query, fragment, parameters, separators.
    • URLs must follow a specific syntax.
    • Domain part is not case-sensitive.
    • Special characters need URL encoding.
    • HTTPS is more secure than HTTP.
    • URLs enable web navigation and sharing.
    • Used in browsers, APIs, apps, and QR codes.
    • Length limit is around 2,048 characters.
    • Beware of phishing URLs — check spelling carefully.

    Key Takeaway

    A URL is the unique address that helps your browser find the right resource on the Internet. From simple website addresses to complex API endpoints, URLs are the backbone of the web. Master URLs, and you'll navigate, understand, and build for the Internet with confidence.

    CONNECTING DEVICES, SHARING WORLD!

    Best of Luck! Practice more, understand URLs better, and explore the amazing world of the Internet! 😊

    Flowchart → Visual Thinking → Smart Solutions → Better Results! 🚀