Guest blog post by Terrence Forsyth
It’s a high likelihood that you’ve been lazy and never taken the time to learn about server response code basics. Well, here’s your chance to clear yourself of being labeled lazy.
It would take forever to discuss every single server response code out there so we’re only going to focus on the most important and most frequent of them here. These are the ones that the average webmaster and SEO should know about.
Server Codes 100 – 199
The browsing public will never notice Server Response Codes in the 100 – 199 range and they will go unperceived.
Request Completed 100: This means that the request to the server was completed and the process can continue as normal.
Protocol Switch Accepted 101: Servers are constantly asked to switch protocols. For example they may switch from the HTTP protocol to the more secure SHTTP protocol or perhaps to the FTP protocol. Code 101 means things went smoothly during the switch.
Server Codes 200 – 299
Codes in the 200 – 299 range mean that a request was successful.
Like the codes in the 100 range, you will never see any of these codes while surfing the web because they mean that everything is working properly.
OK 200: The request went through with success and everything is OK.
Created 201: A new resource was successfully created after posting data from a form, or using CGI, etc.
Accepted 202: The request was accepted but it hasn’t finished being processed.
There are other codes in the 200 range but these are the main three you should understand for the basics.
Server Codes 300 – 399
Multiple Choices 300: This is what I call a confused redirect. It has no idea where to take you because it is pointing to more than one URL. At this point you may possibly be given a choice of where to go. It all depends on the server’s configuration though.
Moved Permanently 301: This is one of the most important codes to understand. If you are changing the URL of your site or you moved domains, use this server code. Search engines won’t penalize this and in fact recommend it. They are not too fond of other redirects but this one is completely kosher.
How do you create a 301 redirect?
Simply create an .htaccess file if you don’t already have one. Then include the following code:
redirect 301 /oldurl.html http://www.newurl.com/newlocation.html
Replace oldurl.html with your old page’s URL and replace http://www.newurl.com/newlocation.html with your new location or URL.
Moved Temporarily 302: You can use 302 redirects when you are forwarding a page or even an entire site to another location but you are planning on using the original site sometime in the future. For example, you might own several versions of the same domain name. The only difference is that they have different domain endings (.com, .net, .org, .biz, etc.). You may want all your sites to redirect to your primary .com domain temporarily.
How do Search Engine’s handle this? Google engineer Matt Cutts says that Google will index the destination page 99 percent of the time to prevent URL hijacking. So in the above case scenario, your .com will be the one getting indexed.
How do you create a 302 redirect? The same way you create a 301 redirect just modify the number.
Other 300 – 399 codes: Yes, there are many other redirects but 301s and 302s are the most important for SEO purposes. You can find information about codes 303 and up at w3.org.
Server Codes 400 – 499
These codes appear when the server request could not be completed. The error here is being made by the person making the request and is not the servers’ fault.
Bad Request 400: This is essentially caused by syntax errors and will appear when bad syntax is used on the requested page.
Unauthorized 401: The request requires user authentication. The Web server thinks that the HTTP data stream sent by your browser was correct, but access to the URL resource requires user authentication Make sure your username and password are correct.
Forbidden 403: A 403 Error Message means just that; that your request is off-limits or forbidden. You might need to get authorization to reach these pages.
Not Found 404: Even if you don’t know anything about server response codes, probably everyone has seen a 404 message on a page that could not be found. A 404 Message is simply a page not found error produced by the server.
A 404 “not found” error message means that we are probably looking for something that does not exist or that has been deleted. A smart SEO or webmaster should take advantage of traffic that lands on 404 error pages and give visitors options as to other available pages they could visit. This can be done by creating custom error pages.
Request Timeout 408: You get a 408 code when your request did not go through in time so it timed out. This most likely happens when there is heavy net congestion. You can simply try your request again in a few moments.
Other 400 – 499 codes: Yes, there are more codes in the 400 range but the one’s mentioned here are the most relevant for our purposes. You can look up the other at w3.org.
Server Codes 500 – 599
Errors ranging from 500 to 599 happened on the server itself. These are different than 400 to 499 codes because 400+ codes were errors beyond the server’s reach.
Internal Server Error 500: Everybody makes mistakes, even servers do. A 500 error means that an unexpected error occurred within the server so it could not complete your request.
Not Implemented 501: Here, you requested something that couldn’t be processed by the server, so this one is your fault, not the servers.
Bad Gateway 502:
A 502 code means that an invalid response was received from the upstream server while the server acted as a proxy or gateway. This simply means that your personal server received an error from the server that you were connecting to.
Service Unavailable 503: The server may be down for maintenance or it may be temporarily overloaded with requests. If you are getting so much traffic that it crashes your server then that’s a good and bad sign. Good because you are the lucky owner of some very popular internet realty, and bad because you should have prepared for this a long time ago.
Gateway Timeout 504: Very similar to a 408 timeout but this time the time out occurs on the server’s gateway.
HTTP Version Not Supported 505: 505 errors mean that the HTTP protocol version that was used while you made the request is not supported by the server. Or the server refuses to handle that specific protocol version. Remember that there may be various versions of the HTTP protocol (e.g. HTTP 1.0, HTTP 1.1, etc) and not all versions are supported by all servers.
Still following me here? We haven’t lost you, I hope. If you’re new to server codes then just take it slow. With a little experience you’ll understand the basics in no time. These are always good to know if you are a webmaster or SEO. So now if somebody asks you about a 301 redirect you can tell them how it’s done.
Emory Rowland is editor at Clickfire, a social media blog for the digitally outspoken. He’s a fanatical blogger, entrepreneur and web hosting enthusiast who occasionally writes for A Small Orange, a business web host. Emory’s love for social media and success with organic search led him to start a SEO consulting venture.