HTTP Status Codes and What They Mean

Web servers return many codes.  Some mean everything is working, and some are errors.  I am going to go over some of the common codes.  Some of these codes you see and some you don’t.

In general there are five blocks of codes.  There are 100, 200, 300, 400, and 500 codes.

100 codes respond with a request for the process of loading a web-page to continue.

200 codes respond that the server completed its process.

300 codes indicate that the web-page has been moved.

400 codes indicate file errors.

500 codes indicate server errors.

I want to call your attention to two codes in particular:

  • 404 – Not Found
  • 500 – Internal Server Error

The 404 and 500 errors are the most common errors encountered.  The 404 error occurs for a few reasons:  the file does not exist, the link is wrong, or the server is case-sensitive and the case of the filename is different.  Here is an example of a link which produces a 404 error.  One reason why there may be 404 errors in an established site is if the links changed radically, or if an old domain is rebooted, with a new topic.  The 500 error is an error in web applications.  It means that the server can not function as intended.  It can be tricky to solve a 500 error.

A 500 error is usually:

  • File or Folder Permissions
  • Bad code or syntax in your .htaccess
  • Improperly configured php.ini

To track down the cause of the 500 error:

  1. Open the Error Logs.
  2. Get your current IP Address
  3. Reload the web page that is causing the error a few times.
  4. Search the error logs for your IP Address for any errors associated with it.

A way to search your error logs is to use a SSH terminal to your web-server:

tail -f [path to logs]/[log file].log | grep [Your IP Address]

Take the code above and fill in the path to your log files, and the filenames of your logs. Then add your IP Address. When you are done push enter and you will see the most recent errors for your server logs. Use the information to help diagonse your server errors.

Written on July 9, 2012