What happens when you open a URL
You'll learn what happens between typing a web address and seeing the page.
Watch & read
Start with the required ones. The others are there when you need them.
See it step by step
From a web address to a page on your screen.
Explanation
You type prothomalo.com and press Enter. A second later the news is on your screen. Where did it come
from? It was not on your laptop. Something had to go and fetch it.
Opening a web page is asking another computer for files, and getting them back. That other computer is called a server. Your browser is the one asking.
A web address, called a URL, tells the browser where to ask:
https://www.prothomalo.com/sports
https://is how to talk. Thesmeans the conversation is locked so others cannot read it.www.prothomalo.comis the domain, the name of the server./sportsis the path, which page you want on that server.
Computers do not find each other by name. They use numbers, called IP addresses, like 104.18.32.7.
So first the browser asks DNS to turn the name into a number. DNS works like the contact list on your
phone. You tap "Ammu", the phone finds the number for you.
Then the browser sends a request to that number: "please give me /sports". The server sends back a
response. The response starts with a status code:
200means OK, here is your page.404means not found. The server is there, but that path does not exist.
The first file is usually HTML, the content of the page. Inside it the browser finds links to more files: CSS for the look, JavaScript for what the page does, and images. It asks for each one the same way. Then it puts everything together and draws the page. This is called rendering.
People often think a 404 means "the internet is down". Not yet. A 404 proves the server answered. Only
the path was wrong. Check for a typo after the /.
When you read a URL, read it in three parts: how to talk, which server, which page.
Code tour
Click a line number with a ring to read the note for that line.
Quick check
3 questions. Each one explains itself after you answer.
- 1 / 3In
https://www.daraz.com.bd/phones, which part is the path? - 2 / 3What does DNS do?
- 3 / 3The browser shows a
404. What does that tell you?