Skip to content
Log In Sign Up info@muvcloud.com

What a Status Code Is

When a browser, an API client, or a crawler sends a request, the server's answer begins with a status line such as HTTP/1.1 200 OK or, in HTTP/2, a status of 200. The code tells software what to do next: show the page, follow a redirect, ask for a password, or retry later. The words after the number are only a label; programs act on the number.

The Five Classes

ClassMeaningExample
1xxInformational, request continues101 Switching Protocols
2xxSuccess200 OK
3xxRedirection301 Moved Permanently
4xxClient error404 Not Found
5xxServer error500 Internal Server Error

The Codes You Will Meet Most

CodeNameMeaning
200OKThe request worked.
301Moved PermanentlyThe page has a new address for good.
302FoundA temporary redirect.
304Not ModifiedThe cached copy is still current.
400Bad RequestThe request is malformed.
401UnauthorizedCredentials are missing or wrong.
403ForbiddenThe server refuses access.
404Not FoundNothing exists at this address.
429Too Many RequestsThe client hit a rate limit.
500Internal Server ErrorThe server failed while handling it.
502Bad GatewayA proxy got a bad answer from the backend.
503Service UnavailableThe server is overloaded or in maintenance.
504Gateway TimeoutA proxy waited too long for the backend.

Check a Status Code with curl

curl -I https://example.com/
curl -s -o /dev/null -w '%{http_code}\n' https://example.com/
curl -IL http://example.com/

The first command prints the headers with the status line at the top. The second prints only the code, which is handy in scripts and monitoring. The third follows redirects and shows every hop. In a browser, the Network tab of the developer tools shows the code of every request on a page.

Redirects: 301, 302, 307, and 308

A 301 tells browsers and search engines that a page moved for good; use it when you change a URL or move to HTTPS. A 302 is temporary, and the old address keeps its place. 307 and 308 are the temporary and permanent versions that require the client to repeat the same method, so a form sent with POST stays a POST. Two redirects that point at each other cause ERR_TOO_MANY_REDIRECTS.

Client Errors

A 4xx code says the server will not or cannot answer this request as sent. A 401 asks for credentials, while a 403 means access is refused even with them; see 403 Forbidden in Nginx. A missing page is covered in 404 Not Found, and rate limits in 429 Too Many Requests.

Server Errors

A 5xx code says the request may well be valid and the server failed. Start with 500 Internal Server Error for application errors and 503 Service Unavailable for overload and maintenance. A 502 or 504 comes from a proxy, such as Nginx in front of PHP-FPM: the backend answered with something invalid, or not in time.

CDN Error Codes and Browser Errors

Codes from 520 upward are not part of the HTTP standard; Cloudflare uses them to report a problem between its edge and your server. The common ones are 522 (no connection), 524 (no response in time), and 525 (TLS handshake failed). Browser messages such as DNS_PROBE_FINISHED_NXDOMAIN and ERR_NAME_NOT_RESOLVED are not status codes at all: the browser never received a response.

Status Codes and Search Engines

  • 301: the new address takes the old one's place in search results.
  • 404 and 410: the page drops out of the index over time; 410 says the removal was intended.
  • 503 and 429: Google slows its crawling and comes back later, which makes 503 the right code for short maintenance; pages that keep failing for long can drop out.
  • Soft 404: a "not found" page that returns 200 may be indexed as content. Return the real code.

Updated:

Linux VPS with Full Root Access

MUVCloud cloud servers run on KVM with Enterprise NVMe SSD storage and full root access, in Turkey, the Netherlands, and the USA.

Cloud VPS Plans Starting at2.99 $/mo Cheap Linux VPS

No Limits on Service or Support

You are not on your own as your projects grow. Our support engineers are ready 24/7, on several channels, whenever you need them.

Support specialist
  • 100% customer satisfaction goal
  • Our own hardware
  • 24/7 ticket and email support
  • 4 countries with locations