HTTP Status Codes: Meaning, Causes and Fixes

Every common HTTP status code explained: what 200, 301, 404, 429, 500 and 503 mean, why they happen, Express fixes and the SEO impact.

Runs in your browser. Nothing is uploaded.

2xx Success

3xx Redirection

4xx Client errors

5xx Server errors

Example

Input:

404

Result:

Not Found: the server has no resource at this URL. Return a real 404 status with a helpful page, 301 if it moved.

How status codes are grouped

The first digit tells you who is responsible. 2xx means success. 3xx means the client must go somewhere else, either a new URL or its own cache. 4xx means the request was wrong: bad input, missing login, no permission, or nothing at that URL. 5xx means the server failed, so the client did nothing wrong and may retry later.

Each code above links to its own page with the meaning, the usual causes, an Express example and what it does to search rankings.

Why the right code matters

Clients, caches, monitoring and search engines all read the status line before the body. An API that returns 200 with an error message breaks retries and alerts. A website that sends its "page not found" screen with 200 creates soft 404s in Search Console. A maintenance page sent as 404 instead of 503 can drop pages out of the index. Choosing the precise code is cheap and makes every layer behave correctly.

Monitoring depends on it too. Error-rate alerts, uptime checks and APM dashboards group requests by status class, so a bug hidden behind 200 never pages anyone, and a flood of 4xx from one client stays separate from real 5xx outages on your side. Retry logic reads it as well: clients should retry 429, 502, 503 and 504 with backoff, and never blindly retry a 400 or 409.

Status codes in Angular SSR and Express

In Express, set the code with res.status() before sending, and finish with a catch-all 404 middleware and one error handler that maps known errors to 4xx and everything else to 500. In Angular with server-side rendering, inject the RESPONSE_INIT token in the page component and set its status to 404 or 503 when the data is missing or the API is down, and add a noindex robots tag to error pages. Without SSR, every route answers 200 from the server, which is the most common source of soft 404s on single-page apps.

Frequently asked questions

What is the difference between 401 and 403?

401 means you are not authenticated (no or invalid credentials). 403 means you are authenticated, or it does not matter, and you are still not allowed.

Should I use 301 or 302 for a moved page?

Use 301 (or 308) for permanent moves so rankings transfer. Use 302 (or 307) only for temporary redirects.

Do 404 errors hurt SEO?

Real 404s for pages that do not exist are normal and do not hurt the rest of the site. Soft 404s and broken internal links are the problems to fix.

Which code should a maintenance page use?

503 Service Unavailable with a Retry-After header. Search engines treat it as temporary.

Related tools