HTTP Status Codes: Ultimate Guide

What are HTTP status codes? In short, they’re like a note from the web server that’s attached to the top of a web page. Don’t mistake it as part of the page itself. It’s just a message from the server that lets you know how the request to view the page went. 

These messages happen every time your browser interacts with a server, though you might not actually see them yourself. If you own your own website, it’s essential that you learn the basics of these HTTP status codes. While hopefully, they won’t happen often, it’s important to know what they mean when they do occur so you can take care of them quickly. 

In this guide, we’ll explain the different HTTP status codes you might encounter as well as what they mean for your website or server. Save this ultimate guide for later so you’re never caught off guard. 

Where Do HTTP Status Codes Come From?

Before we dive into the individual codes, we need to learn a bit about where they come from in the first place. Whenever you click on a link or type in a URL, your web client (browser) sends a request to a web server. This web server is where the web site’s files and elements are stored. The web server then receives that request from your browser that you want to access this page, and it sends back the requested resources with an HTTP header. 

These status codes always come back through your browser, but you’ll only actually see them if something goes wrong during the request. When you do see a status code, it’s the server telling your browser that something isn’t right. 

If you’re using a developer-friendly browser like Chrome, you can use a fetching tool like Web Sniffer to see the status codes every time. Now it’s time to break down the different status codes. 

HTTP Status Code Classes

There are 5 classes of status codes. Each class refers to a different status or problem.

 

  • 100’s – Informational code that lets you know the request is still in process. 
  • 200’s – Browser request is returned successfully. 
  • 300’s – A redirection is happening in which a new resource has been substituted.
  • 400’s – There was a problem with the request on the client end. 
  • 500’s – There was a problem on the server end.

 

As you likely already know, the list doesn’t stop here. There are a variety of server codes within each of these classes, and each one has its own meaning.

Full List of HTTP Status Codes

There’s a long list of server status codes you could potentially run into, but you’re much more likely to only see a dozen or so regularly. If you’re running a website, here are the codes you should be aware of as well as what they mean. 

200 Status Code

 

  • 200 “OK” – Everything is working properly. 

 

300 Status Codes

 

  • 301 “Moved permanently” – The web page or resource has been permanently replaced. Usually used for permanent URL redirection. 
  • 302 “Moved temporarily” – This code indicates the resource was found but in an unexpected location. 
  • 304 “Not modified” – The resources stored in the browser cache haven’t changed, so these old files can be used.

 

400 Status Codes

 

  • 401 “Unauthorized” – The target resources isn’t authorized. 
  • 403 “Forbidden access” – The user is not allowed permission to see this content. It might be password protected. 
  • 404 “Not found” – This is the most common error message you’ll encounter. It means the requested resource either can’t be found or it doesn’t exist. 
  • 405 “Wrong method” – The server supports the method received, but the target resource won’t allow it. 
  • 408 “Timed out” – The server timed out while waiting for the request from the browser. 
  • 410 “Gone for good.” – Like 404, this indicates the condition is permanent and expected. 
  • 429 “Too many requests” – The user has sent too many requests in a given time, usually from bots attempting to access your website. 

 

500 Status Codes

 

  • 500 “Server error” – An error happened to the internal server so the recourse was not delivered. This is common with problems in faulty plugins, PHP, or other database issues. 
  • 502 “Bad gateway” – The server has received an invalid response from another and has canceled the connection. 
  • 503 “Unavailable server” – The server is overloaded and can’t handle additional requests.

 

Protecting Your Website

Whether you’re a developer or website owner, knowing these codes above will help you understand more about how your website is performing. Similarly, when you encounter these codes during your own time exploring the internet, you’ll have a better understanding of what they mean. 

An easy way to monitor your own website’s real-time status is with logging. The Loggly site had resources and tools available to monitor your server status, including these requests above. You can’t afford to ignore these messages when they’re received, even if they might not always be clear at first. Is your website protected?