Skip to content

Troubleshooting guide

HTTP status codes explained, with fixes for the common errors

Every HTTP response starts with a three-digit status code. The first digit tells you who has to act: the client, the server, or nobody. Here is what the codes you will actually meet mean, and where to go when one of them is an error.

5 min read10 sectionsUpdated

On this page

Key points

  • 2xx success, 3xx redirect, 4xx client error, 5xx server error.
  • 4xx means change the request; 5xx means fix the server.
  • Monitor the code, not just "up or down": a 403 or a 302 to a login page is an outage too.

The five classes

ClassMeaningWho acts
1xxInformational, such as 101 Switching Protocols for WebSocketsNobody, usually invisible
2xxSuccessNobody
3xxRedirection: the resource is elsewhereThe client follows the Location header
4xxClient error: the request was wrong or not allowedThe client changes the request
5xxServer error: a valid request failed on the serverThe server owner fixes it

The codes you will actually meet

CodeNameWhat it usually means
200OKSuccess.
201CreatedA resource was created, for example by a POST.
204No ContentSuccess with an empty body.
301Moved PermanentlyPermanent redirect; search engines transfer the old URL's signals to the new one.
302 / 307Found / Temporary RedirectTemporary redirect; 307 keeps the method and body.
304Not ModifiedThe cached copy is still valid.
308Permanent RedirectPermanent, keeping the method and body.
400Bad RequestMalformed request: invalid JSON, a missing field, a header that is too large.
401UnauthorizedNo or invalid credentials.
403ForbiddenValid request, refused. [How to fix 403](/guides/403-forbidden).
404Not FoundNo resource at this URL.
405Method Not AllowedThe URL exists but not for this method, such as GET on a POST-only endpoint.
408Request TimeoutThe client took too long to send the request.
409ConflictThe request conflicts with the current state, such as a duplicate or a version mismatch.
410GoneRemoved on purpose; search engines drop it faster than a 404.
413Content Too LargeThe body exceeds the server's limit.
422Unprocessable ContentWell-formed but invalid data, common in APIs.
429Too Many RequestsRate limited. [How to fix 429](/guides/429-too-many-requests).
500Internal Server ErrorAn unhandled error on the server. [How to fix 500](/guides/500-internal-server-error).
502Bad GatewayA proxy got an invalid response from the upstream. [How to fix 502](/guides/502-bad-gateway).
503Service UnavailableOverloaded or in maintenance. [How to fix 503](/guides/503-service-unavailable).
504Gateway TimeoutA proxy waited too long for the upstream. [How to fix 504](/guides/504-gateway-timeout).
520 to 524Cloudflare origin errorsCloudflare could not get a good response from your server: [520](/guides/cloudflare-error-520), [521](/guides/cloudflare-error-521), [522](/guides/cloudflare-error-522), [524](/guides/cloudflare-error-524).

Status codes and search engines

  • Use 301 or 308 for permanent moves so rankings follow the page; avoid chains of redirects.
  • Return a real 404 or 410 for missing pages. A "soft 404" (an error page with status 200) wastes crawl budget and confuses indexing.
  • Keep 5xx errors short-lived. Crawlers back off when they meet repeated 5xx responses, and pages that keep failing can drop from the index.
  • Prefer 429 or 503 with Retry-After to tell crawlers to slow down, rather than failing with 500.

Check a status code yourself

bash
# status code only
curl -s -o /dev/null -w '%{http_code}\n' https://example.com/
# follow redirects and show each hop
curl -sIL https://example.com/old-page | grep -iE '^(HTTP|location)'

Monitor the status code

An uptime monitor that expects a specific status (and optionally a keyword in the body) catches the failures a simple ping misses: a 500 on checkout, a 403 from a new firewall rule, a 302 to a login page after a configuration change. Pair it with alert rules per status class so the alert already says what kind of problem it is.

Frequently asked questions

What is the difference between 4xx and 5xx?

4xx codes mean the request should change: it was malformed, unauthorised or too frequent. 5xx codes mean the request was fine and the server failed to handle it.

Is a 404 bad for SEO?

No. A real 404 for a page that does not exist is correct. Problems start with soft 404s (error pages returning 200) and with important pages that return 404 by mistake.

Which status codes should an uptime check accept?

Usually only 200 for a page, or the specific success code an API returns. Accepting every 2xx and 3xx can hide a redirect to a login or error page.

Check it now, free

Watch your own site and services with VitalRix

Uptime checks, APM, logs, real-user monitoring, alerts and status pages in one place. Every product has a free tier and no credit card is needed.