500, 404, 301, what are HTTP error codes?

 

Have you ever seen the white screen of death in WordPress? Ever tried to go to a page that didn’t exist? Both of these scenarios have a server code and there are many other codes. Knowing that they exist can help you diagnose what’s happening, and give you evidence to take to support.


This tip was sponsored by OSTraining.com! OSTraining aims to explain websites so clearly that anyone can understand, with jargon-free, hands-on training that clearly defines processes to simplify complex tasks. OSTraining offers online courses, best-selling books, onsite training, and online live training.

More than 100,000 students have learned website development through OSTraining. OSTraining courses focus on web development and the tools around it, including WordPress, WooCommerce, Drupal, Magento, and Joomla.


Transcription

Hey folks, welcome to another HeroPress Tip of the Week. This week we’re going to take a look at HTTP response status codes, which sounds really technical and weird, but they’re really easy to understand. And they can be helpful to help you understand what’s going on. 

Anytime your web browser asks a website for something, the response that it gets back has a number code associated with it. There are five different kinds of responses: informational responses, successful responses, redirection messages, client error responses, and server error responses. Now, I’m not going to look at every single one of them with you in this video because this is an overview video. But we’ll look at a few that I’ll bet you’ve seen before, and that’ll help you understand how to research others that you haven’t seen before. 

Informational responses are in the 100s. There’s only four of them. I’ve never seen one on a screen. So you probably won’t either. 

Successful responses. These are the ones you want. And again, you probably won’t see them because it means that your request was successful. 200 is the most common. When you ask for a web page, and it sends one back, that’s a 200. There are other 200s here, there are quite a few actually, and most of them deal with creating content or something like that. There’s this one here called “no content” that looks like it could be an error, but it’s not. It’s just letting you know your request was successful, I just don’t have anything to say. 

Let’s take a look at the 300s. 301 is probably the one most important to you. It means moved permanently. So if you change the URL of a web page or post, a blog post and you want Google to know, “hey, the old one is gone, but it moved over here to this new on”e, you need to put in a 301 redirect message on the old address.

Now plugins like Yoast and All in One SEO will help you do that. In fact, Yoast, if you change the name of a page will say, “Hey, I see you changed this. Would you like me to make a 301 for you?” And you say yes, and it’s just done. This can be really important for your SEO because you want Google to know that the address that they were looking for isn’t an error, it just moved, and Google then finds the new content and guides people appropriately. 

300s, I don’t think you’ll ever see… well, there’s temporary redirect and permanent redirect. You probably aren’t going to run into those. 

The 400s are the ones you’ll probably see most. A 400 is a bad request. And that means that something you sent in your link is asking the server for something it doesn’t know how to deal with. And you might see the words “400 bad request” on your screen. 

401 unauthorized. Sometimes you’ll go to a site that needs authentication, but has a little pop-up rather than a form on a webpage. That’s server authentication. And if you don’t put in the right information, you’re going to get a 401. And it’ll say that right on the screen. 

402 doesn’t exist yet. 403 is forbidden. If you try to go to a web page, but the permissions on the server are set to say, No, don’t serve this to anyone, you’ll get a 403. 

And the infamous 404. Everyone knows the “404 not found.” That’s when you’re looking for a page and it’s just gone now. And it’s so common that people make clever videos and have fancy pages just for that. 

We’ll skip the rest of the four hundreds, but I recommend reading through them. Actually, we’re going to do “418 I’m a teapot”. This was a practical joke. It started out as an April Fool’s joke. The server is refusing to attempt to brew coffee with a teapot. And that’s it. That’s just all there is to it. 

The next ones you’re going to find are 500s. The 500 internal server error. In WordPress, this most often looks like the infamous white screen of death where you just get a white screen with no messages at all. What’s happening is that something broke in the code and the server doesn’t even know how to express what’s going on. So it just says something broke. You can turn on error logs and things like that to print things to the screen to tell you what the problem was. But most people turn that off in production because they don’t want the whole world to see what the problems were. So 500 internal server error is one that you’re going to run into most. 

The gateways are common problems. If there’s a networking issue and you can’t get to the page on the network, you’ll get bad gateway or a service unavailable or something like that. And that’s it. That goes up to 511. 

At the top, you see here that it has like 100 through 199. And yet there are only four in the 100s. So they’re padding their options for future error codes. But if you get an error code that you don’t understand, or you don’t know what it means, just Google it. Google “HTTP error code,” whatever, “302” and it will tell you. In fact, this page if you actually click, it goes to a whole thing about what it means. 

This can be useful when you’re going to support to say, I tried to get to my webpage and it gave me… let’s see, gave me a 507 insufficient storage. And this one applies to WEBDAV, which is like an FTP server. And if you don’t have WEBDAV, and you tell them you got a 507, they’re gonna go, “Oh, something’s really wrong,” and then know where to look. So when you get an error, or you see a code on your page, look up what it means and take that information to support when you go ask for help. I hope you find this useful.