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
- 200 OKHTTP 200 OK means the request succeeded and the response body contains the requested resource.
- 201 CreatedHTTP 201 Created means the request succeeded and a new resource was created, usually by a POST.
- 204 No ContentHTTP 204 No Content means the request succeeded and there is deliberately no response body.
3xx Redirection
- 301 Moved PermanentlyHTTP 301 Moved Permanently means the resource has a new permanent URL, given in the Location header.
- 302 FoundHTTP 302 Found is a temporary redirect: the resource is at another URL for now, and the original URL stays canonical.
- 304 Not ModifiedHTTP 304 Not Modified means the cached copy is still valid, so the server sends no body and the client reuses its cache.
4xx Client errors
- 400 Bad RequestHTTP 400 Bad Request means the server could not process the request because the client sent something malformed or invalid.
- 401 UnauthorizedHTTP 401 Unauthorized means the request has no valid authentication: the client must log in or send a valid token.
- 403 ForbiddenHTTP 403 Forbidden means the server knows who you are, or does not care, and refuses the request anyway.
- 404 Not FoundHTTP 404 Not Found means the server has no resource at this URL, and says nothing about whether it ever existed.
- 409 ConflictHTTP 409 Conflict means the request clashes with the current state of the resource, such as a duplicate or a stale update.
- 410 GoneHTTP 410 Gone means the resource existed but was removed on purpose and will not come back.
- 422 Unprocessable ContentHTTP 422 Unprocessable Content means the request was well-formed but its data failed validation.
- 429 Too Many RequestsHTTP 429 Too Many Requests means the client hit a rate limit and should wait before trying again.
5xx Server errors
- 500 Internal Server ErrorHTTP 500 Internal Server Error means the server hit an unexpected error and could not complete the request.
- 502 Bad GatewayHTTP 502 Bad Gateway means a proxy or load balancer got an invalid response, or no response, from the server behind it.
- 503 Service UnavailableHTTP 503 Service Unavailable means the server is temporarily unable to handle the request, for example during maintenance or overload.
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.
