A 301 and 302 Redirect Primer

We often recommend 301 redirects and we recognize that many times clients don’t understand what that is or how and why you would use it. So we put together this little fact sheet so there was an understanding of what it is, when to use it and how to do it.

First a 301 or a 302 redirect is a line of code that is put in a file called a .htacess file. Because of the period (dot) this file is not visible via your FTP client. So the first thing to know is if you have something in this file. Often if your using wordpress, you will have configuration instruction in the file so we would recommend using the file manager inside your Plesk control panel to access the file.  Also we advise you to create a copy of the file and name it .bak so that you have a backup incase you make a mistake.

How do I make a 301 (or 302) Redirect?

The line that you would put in will look like this:

Redirect 301 /two http://www.newdomain.com/other

The anatomy of that line is this /two is the page you want to redirect. It is the URL path you will see in a web browser and should include everything after your domain name (www.yourname.com). Another example would be this:

/news/month/article.html would be another way you might see this.

The second part is where you want the page to redirect to it much contain the full URL including the http as in the example above. Often this is case sensitive so we would recommend doing this exactly as it appears in your browser with the domain ALWAYS being in lower case. Note you may have issues if you have a space in your url so web hosting is really web%20hosting to a URL. Try to avoid using spaces to avoid issues moving forward.

The uses of a 301 redirect is a permanent change of address for the file. We often liken it to a change of address at the post office so your mail can be forwarded.  Times that this would be used is when you are removing or changing the name of a page on your website. Remember people in the outside world may link to the page and when your don’t attach a proper 301 to it, you will lose the link and your page will issue a not found, which is viewed negatively. We frequently see this problem with Webmaster who update the website with a new design or change its platform and abandon the old pages but leave no forwarding address for them. This is one of the most damaging mistakes we see.

 

What is a 302 redirect and when should I use it?

A 302 redirect is a temporary situation but it very often misused and doesn’t transfer the power of the website right. The 302 redirect is also the default on the server, so when one isn’t specified it will default to this and its should not be used in lieu of the 301. The 302 being temporary should be used if your page is being taken down for maintenance or for some reason you need a page to go someplace for a small period of time. Uses for a 302 is not common, although we often see it mis-applied by webmasters.

 

Was this page helpful?

Do you have any feedback or suggestions to improve this page?