The Side Quest
πŸ”Ž

How A URL Is Built

The address bar holds six engineered pieces glued together by punctuation. Each one means something specific β€” and one mistake breaks the whole thing.

#internet#technology#design
← All guides

A URL looks like one string, but it's six nested parts, each with a job. Take this example:

https://example.com:443/articles/2026/popcorn?sort=new#top

The scheme β€” https://

What protocol to use. https means a secure HTTP request. Others: http, ftp, mailto, file. The :// separator tells the browser "what follows is a network location."

The host β€” example.com

The domain name. The browser will look this up in DNS to get an IP address β€” the actual machine on the internet where the website lives.

The port β€” :443

Which "door" on that machine to knock on. https defaults to 443, http to 80. Usually omitted because the default applies. Custom ports (:8080, :3000) are used for dev servers or private services.

The path β€” /articles/2026/popcorn

The location on that machine. The server decides what this means β€” often it maps to a folder and file, but increasingly it's just a route handled by code. The path is case-sensitive on most servers.

The query string β€” ?sort=new

Key-value pairs after the ?, joined by &. These are parameters passed to the server: ?sort=new&page=2&lang=en. They're visible in the address bar, bookmarkable, and not secret.

The fragment β€” #top

A specific spot within the page. The fragment is never sent to the server β€” the browser handles it locally, scrolling to an element with id="top". That's why clicking a footnote jumps without reloading.

Why one typo breaks everything

Each piece has strict syntax:

  • Scheme and host are case-insensitive.
  • Path and query are usually case-sensitive.
  • Spaces must be encoded as %20, special chars as %xx.
  • A misplaced ?, #, or / changes meaning entirely.

The URL is one of the most successful mini-languages ever built. Six pieces, a handful of punctuation rules, and the entire web is addressable by typing a single line.

Written with πŸ’– by Waela Β· Back to The Side Quest

Built with πŸ’– by Waela