This is part 1 of “Build Your Website from Scratch”, a running series in which we build one real website step by step until it is live and indexed by Google. A new part lands every day at 8:00 PM, and each part builds on the one before it.
Before we write a single line of HTML, we need to understand what actually happens when someone types your domain and presses Enter. That understanding is what later lets you work out why a page is slow, why an image is missing, or why a site is down, and fix it yourself.
What you will build in this series
- A complete website: HTML pages, a responsive CSS layout, JavaScript interaction, then a PHP admin panel and a MySQL database.
- A real deployment: hosting, an SSL certificate, and a connected domain.
- Measured improvements in speed, security, and search visibility.
No prior experience is needed. Every part includes step-by-step screenshots, copy-ready commands, and an “expected result” section so you can confirm you are on track.
1. The big picture: five steps between Enter and a rendered page
When you open https://noor4tech.com/ar/, this is what happens, in order:
- DNS: the domain name is translated into a numeric IP address.
- TCP + TLS: the browser opens an encrypted connection to the server on port 443.
- HTTP request: it asks for a specific page and sends headers describing what it can accept.
- Response: the server returns a status code and an HTML document, followed by CSS, JavaScript, and images.
- Rendering: the browser builds the page tree and paints it on screen.
The whole trip usually takes under a second. A problem at any step shows up differently: a missing page, a slow page, or a page with no styling. That is why we start here.
2. Step one: DNS turns a name into an IP address
The browser does not know “noor4tech.com”; it knows numbers. DNS is the address book that maps readable names to IP addresses, and the lookup usually goes through your ISP or a public resolver such as Google Public DNS.
Here is a real lookup for the Noor4Tech domain:
Reading the answer:
"Status":0: the query succeeded. Any non-zero value means failure or a domain that does not exist."type":1: an A record, meaning an IPv4 address."TTL":7200: how long the answer may be cached, in seconds (two hours)."data":"192.250.239.194": the address of the server hosting the site.
Try it on any domain:
dig example.com +short
# prints the site's IP address
# on Windows:
nslookup example.com
A practical tip that saves hours: when you move a site to new hosting, the new address does not appear for every visitor instantly, because resolvers keep the old answer until the TTL expires. Lower the TTL to 300 seconds a day before the move, then raise it again once everything works.
The response arrives as JSON, and you can format it readably with our free JSON formatter.
3. Step two: the connection, TCP, TLS, and port 443
Once the browser knows the address, it opens a connection on a port: 80 for HTTP and 443 for HTTPS. Most sites today serve only on 443 and redirect anything on 80 to the encrypted version.
Before any data flows, a TLS handshake takes place: browser and server agree on encryption, the server presents its certificate, and the browser verifies that the certificate was issued by a trusted authority and actually covers that domain. The Noor4Tech certificate is issued by Let’s Encrypt and covers noor4tech.com, www.noor4tech.com, and the mail hostnames.
Why it matters: everything travelling between visitor and server, including passwords and form data, is encrypted. Chrome marks sites without HTTPS as “not secure”, and Google treats HTTPS as a ranking signal.
The site also advertises HTTP/3 through the alt-svc response header, which reduces connection time on networks with packet loss, such as mobile networks.
4. Step three: the HTTP request, exactly what the browser sends
An HTTP request is plain text you can inspect yourself. This screen from httpbin shows the headers a real browser sent:
Requesting a page from your own site looks roughly like this:
GET /ar/ HTTP/2
Host: noor4tech.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 Chrome/158.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding: gzip, deflate, br
Accept-Language: ar,en;q=0.9
- Host: which site is wanted. One server hosts hundreds of sites, and this header selects one.
- User-Agent: the browser and operating system; servers use it to serve suitable formats such as WebP instead of JPG.
- Accept: the content types the browser accepts.
- Accept-Encoding: supported compression formats. This is why the page arrives much smaller: Noor4Tech responds with
br(Brotli) compression instead of raw text.
The response begins with a status code. The common ones:
200 OK: success.301/302: the page has moved. A real example:http://noor4tech.comanswers301and redirects tohttps://noor4tech.com/.404: page not found.500: a server or application error.
5. Step four: the response, and HTML arrives first
The server replies with an HTML document. This is the actual code delivered for the Noor4Tech FAQ page, viewed with View Page Source:
Note these elements, because you will write them on every page you build:
<!doctype html>: tells the browser this is modern HTML.<html lang="ar" dir="rtl">: page language and direction. Without them, Arabic can render incorrectly.<meta charset="utf-8">: character encoding. Omit it and Arabic turns into symbols.<meta name="viewport">: the foundation of responsive design on mobile.<title>and<meta name="description">: what appears in search results.<link rel="canonical">andhreflang: the preferred version of the page and its language variants, which prevents duplicate content.application/ld+json: structured data that search engines understand.preconnectanddns-prefetch: starting external connections early.
Most importantly, the document does not build the page on its own. It links to CSS files, fonts, scripts, and images, and every one of those is a separate request. Each extra request adds time, and that is the root of most slow Arabic sites.
If the HTML itself is large, you can shrink it with our free HTML minifier without changing the result.
6. Step five: how the browser renders the page
The browser goes through four stages:
- DOM: it converts the HTML into a tree of elements.
- CSSOM: it collects all style rules into another tree.
- Render tree: it merges both into the elements that will actually be drawn.
- Layout, then paint: it calculates position and size, then draws pixels.
This is where the script loading order matters:
<script src="app.js"></script> <!-- blocks parsing until it runs -->
<script src="app.js" defer></script> <!-- runs after the DOM is built, in order -->
<script src="app.js" async></script> <!-- runs as soon as it arrives, out of order -->
The later rendering starts, the longer a visitor stares at a blank screen and the worse your performance metrics get. We covered this in detail in our Core Web Vitals guide, and we will measure it on our own site in the performance part of this series.
7. Do it yourself in three minutes
- Open any site in Chrome and press
F12to open DevTools. - Go to the Network tab, enable Disable cache, and reload.
- Read the first row:
Status,Type,Size,Time. The first row is usually the HTML document. - Click the row and open Headers: Request URL, Request Method, Status Code, and the Response Headers such as
serverandcontent-encoding. - Read the totals at the bottom: number of requests, transferred size, total time.
Expected result: you see an HTML document with status 200, followed by dozens of requests for CSS, images, and scripts with different sizes and times. A 404 means a broken link to fix, and a 301 on an internal page means the link should point to the final URL directly.
8. Common beginner mistakes
- Assuming a site is “one file”: a page is the result of dozens of requests, which is why heavy images hurt everything.
- Forgetting
charsetordir="rtl": Arabic text breaks or flips on mobile. - Mixing domain variants: with and without
wwwbecome two different sites unless one redirects to the other with 301. - Uploading heavy files uncompressed: one 4 MB image can double load time on mobile.
- Editing a live site without a backup: the most dangerous mistake and the easiest to prevent.
9. Summary and what comes next
Every page request is five steps: DNS, an encrypted connection, an HTTP request, a response, and rendering. That model is the foundation for everything we build next.
In part 2 we set up the working environment: installing VS Code, the useful extensions, and creating and previewing your first HTML file, with the same level of detail.
If you would rather have a finished site than build one yourself, you can request a website design service from the Noor4Tech team.
FAQ
Do I need paid hosting to start learning?
No. You can build and open every page locally in your browser. Hosting is only needed when you publish, and we will compare options and prices before you pay anything.
What is the difference between HTTP and HTTPS?
HTTPS is HTTP inside a TLS-encrypted connection. The content is the same, but nobody on the network can read or modify it in transit, and the browser verifies the server’s identity with a certificate.
Why does the page appear blank for a moment?
Because the browser must download the HTML first, then CSS, fonts, and scripts, and only then build and paint the page. Every slow file extends that gap. Fewer and smaller files is the main fix.
Do I need to learn networking before web development?
No, but the basics in this article are enough to start: DNS, ports, and HTTP requests. You will learn the rest by doing it inside this series.
🔗 Official sources
- MDN: How browsers work
- MDN: Overview of HTTP
- MDN: DNS glossary entry
- Cloudflare: What is DNS?
- Google Public DNS — live lookup tool
- httpbin — inspect your request headers
- web.dev: Learn performance
Series: part 1 of “Build Your Website from Scratch” — series index · Next: setting up your environment and your first HTML page.
Comments (0)
No comments yet. Be the first to comment!
Add Your Comment