Skip to content

How websites work

About 25 minutes · read, practise, then check your understanding

Every web developer, tester and cloud engineer works with this journey every day. When something breaks, knowing each step tells you where to look.

You will learn

  • What a browser and a server are
  • What the parts of a URL mean
  • What an HTTP request and response are
  • How to see a real request in your browser

Before you start

  • You can open a website on a phone or computer. Nothing else.

The idea, simply

A website is a set of files that live on a computer somewhere else in the world. That computer is called a server. The app you use to open websites (Chrome, Firefox, Safari) is called a browser.

When you type an address or tap a link, your browser sends a message to the server asking for a page. That message is a request. The server sends back a message with the page inside. That is the response. The language both sides use for these messages is called HTTP.

  1. You type a URL
  2. Browser sends a request
  3. Server finds the page
  4. Server sends a response
  5. Browser shows the page
One page load, step by step. It usually takes less than a second.

The address itself is a URL. Each part has a job:

https://www.example.com/courses/html?lang=ta
└─┬──┘   └──────┬──────┘└────┬──────┘└──┬───┘
protocol     domain        path       query
The parts of a URL
  • Protocol (https): the rules for the conversation. The 's' means it is encrypted, so others on the network cannot read it.
  • Domain (www.example.com): the name of the server. A system called DNS turns this name into the server's number address (an IP address).
  • Path (/courses/html): which page or file you want on that server.
  • Query (?lang=ta): extra details, here 'show it in Tamil'.

Every response carries a status code, a three-digit number that says how the request went. 200 means OK. 404 means the page was not found. 500 means something broke on the server.

See it in action

  1. Type the URL

    You type https://www.wikipedia.org and press Enter.

  2. Find the server

    DNS translates wikipedia.org into an IP address, like looking up a phone number in your contacts.

  3. Send the request

    Your browser sends: GET / (give me the home page).

  4. Get the response

    The server replies with status 200 and an HTML file.

  5. Ask for the rest

    The HTML mentions images, styles and scripts, so the browser sends more requests for each of them.

  6. Show the page

    The browser puts everything together and draws the page on your screen.

Common mistakes

Thinking the website lives inside the browser.
The browser only displays it. The files live on a server and travel to you on every visit.
Treating 'internet' and 'web' as the same thing.
The internet is the network. The web is one service that runs on it, like email or video calls.
Ignoring the status code when something fails.
Always check it in the Network tab first. 404 and 500 point to very different problems.

Key takeaways

  • A browser asks; a server answers. The question is a request and the answer is a response.
  • A URL has a protocol, a domain, a path and sometimes a query.
  • Status codes tell you what happened: 200 OK, 404 Not Found, 500 server error.