We are aiming to raise £10k to help 4 small local charities in Brixton. Visit our Just Giving page.

HTTP Codes: What are 301 and 302 redirects?


Sometimes when you try to figure out how the internet works it feels like you are delving into the inner fabric of the matrix.

And it’s not like you can download this Kung Fu into your head. At least, not yet.

So, for now, we’ll have to get by with some manual learning and today on the menu we have HTTP Codes, specifically URL redirects.

Ok, let’s swallow our red pills and tumble down this rabbit hole already…

HTTP Status Codes

You may already recognise HTTP. It’s that bit at the beginning of every URL: http://www.IKnowKungFu.com.

It stands for HyperText Transfer Protocol, which is the foundation for all online data communication.

Think of it as computer etiquette.

It involves the handover of status codes between web servers (your computer/smartphone) and the user or search engine who is trying to make an online request.

Let’s take a quick step back.

Imagine yourself a library, which we will use as an analogy for the web. This library contains all the books (websites) and all the pages in the world.

If you know the specific book you want, you can, of course, find it within the library yourself. However, most of the time we need a hand in finding the book we need. We might know the genre, for example, a book on flags, but not know which specific book to read. To help us out, we might turn to a librarian for help.

Yep you’ve probably guessed it, Google* is the kind, bespectacled librarian in this scenario and it will do its best to help you find the book you’re after.

(*other librarians are available)

The thing is, as Google is so busy with 6 billion requests a day it isn’t going to make the journey to get every book. Nope, the library has bots for that. Superfast bots that can carry out your requests in the blink of an eye.

These bots are in constant communication with Google and/or you the user, reporting the response and status of your request.

These messages are what we refer to as the HTTP Status Codes. They take the form of 3 digit numbers and are divided in 5 categories:

100s – Informational: This is when the request has been acknowledged and the process is ongoing.

200s – Success: The request was successful and the user has arrived at their desired page. Everyone has a party.

300s – Redirection: The request was received but a further step must be taken for the request to be successful. Imagine a note where your book should be, directing you to its new location in the library.

400s – Client Error: Somewhere along the way an error has occurred and the page the user has requested is invalid.

500s – Server Error: The user request was valid but the server couldn’t complete the request.

For today, we shall focus on redirects – that is, HTTP codes in the 300s.

301s and 302s

A redirect is necessary when you want to divert a user to a new URL page that you have created. The two most common types are 301s and 302s.

A 301 redirect is when you permanently want to migrate a page across to a new URL. They are known in the SEO world as a ‘Permanent Redirect’. You may want to use a 301 redirect if you are changing domain, upgrading your site or because your old page isn’t working any more.

If you remember from my last blog, in the eyes of the search engine your webpage has a certain link value, otherwise known as ‘link juice’. The great benefit of performing a 301 redirect on your page is that all that valuable link juice is transferred to your new URL. Matt Cutts (Head of the Web Spam Team at Google) tells us that:

The amount of PageRank that dissipates through a 301 is currently identical to the amount of PageRank that dissipates through a link

However, it must be stressed that a 301 is a permanent manoeuvre – so only be prepared to perform one if you are prepared for it to last.

On the other hand, a 302 redirect happens when you wish to temporarily divert traffic from a web page to a new URL. From an SEO perspective, 302’s are not recommended as they do not pass on rank power between domains.

If you would like to chat more about header response codes (and why wouldn’t you?) feel free to tweet us your questions!