You may hear us throw around these numbers during meetings and sit there and nod and look thoughtful as you wonder to yourself “What the heck are they talking about” Fortunately a small understanding of just a few numbers will vastly improve your knowledge of how the web works and you’ll have a great conversation starter at your next party. Ok, not really, but you will appear smarter to your friends.
The web is built around a request/response model. When you type in www.tkg.com and hit enter, you begin the request process. That request travels the Internet and lands on our webserver. The server then responds to that request and the loading of the webpage begins. Since there are so many variables between you and the webserver Tim Berners-Lee (the father of the web) devised this numeric code to keep both you and the server in sync to what’s actually happening.
The numbers are actually sort of a family of similar meanings with each hundreds place defining the family.
A 2xx response is a Successful response. When the server responds with a 200, its telling your browser everything is A-OK and here comes the webpage. Other 2xx codes also mean success, but vary on the conditions.
The 3xx family begins the redirection family. A 301 response tells the browser (or search engine) that what you requested has gone away, and all future requests should be directed to the specific URL. An example of this may be changing the URL www.tkg.com/danhall to www.tkg.com/dan-hall The server will see the “danhall” request and tell the requester go to “dan-hall” instead. This is very important when dealing with SEO strategy because a search engine will transfer any ranking it built for ‘danhall’ to ‘dan-hall’.
Next up is the 4xx family. Sorry, but this group basically indicates you did something wrong. Say you try to go to www.site.com/restricted-area A server would respond with a 401 code which means you simply aren’t allowed because you’re not authorized. This would trigger the browser to prompt you for a user name/password which in turn the server authorizes and you get in. Another common 4xx family member is the dreaded 404. This simply indicates that what was requested couldn’t be found. Sites sometimes take this response and give back a sitemap, or a friendly message prompting the user to check the URL and try again.
Finally, we have the 5xx family. Remember the web is a request/response model, right? We handled errors in the request side with the 4xx family, so the 5xx family handles errors in the response side. 500 is a generic response that something crazy happened on the server, but not additional details are available. 503 will be given back if the server is unavailable. This may be that it is overloaded, or down for maintenance.
There you have it, a small break down of some common codes used on the web. Next time you see a broken image, or get a picture of a broken robot instead of the latest news you’ll know you just encountered a 404 error. If you load www.facebook.com and scroll through the latest memes you can say “thank goodness for 200 responses” Well, maybe not, but hopefully this little guide has helped you demystify a small section of how the web works.