Redirect 301 Explained

Posted by EssexMax on 6 July 2012 under Site Enhancement | Be the First to Comment

This page outlines some of the basics regarding page redirects.

Why would you need to redirect a page?

There are several reasons – here are a few:

  • To handle a dead page. For example, you have a page that talks about a product, but now need to remove that product. You want to redirect your visitors to an alternative product
  • You want to hand out a short web address – For example, essexmax.co.uk/seo , which redirects to a different location
  • You need to move a page or a site

The handle these kinds of situation, the best way of doing this is with what’s called a “Permanent Redirect” or a “301 Redirect”. These will direct your site visitors to the correct location invisibly, and are also instructions to a search engine that a page have moved and the traffic (and page authority) should be moved to the new home

How do I redirect?

There are several methods, some better than others. Most web servers run on either Apache/Linux, or Windows. Both platforms have different ways of handling redirects. The EssexMax team is far more experienced with Apache/Linux, so here, we’ll explain how to handle a redirect using that system. If you need help with a Windows system, please see IIS HTTP Redirects

301 Redirect on an Apache / Linus Web server

Redirects are handled inside a text file called .htaccess – Your serve may have one of these in the root folder. If not, it’s a case of creating one with a text editor such as Windows Notepad, adding details of the redirects, and uploading it. Note that the filename “,htaccess” is all lowercase and has a dot at the front.

Here is a screenshot showing the root directory of a web site, and you’ll see that .htaccess is the first item in the file list

Website Folder Structure

Screenshot of a website root folder

The .htaccess is a pretty important file, and it’s checked each time someone surfs to your site. You need to be careful when playing around with this file, and if you make changes, you need to test the changes carefully. It’s easy to make a small mistake, and redirect all of your traffic to a dead page, so do handle with care.

Here is a screenshot of a basic .htaccess file. Here, it’s being edited with Windows Notepad and shows three directs:

htaccess Redirect 301 example

htaccess Redirect 301 example

The EssexMax website uses a redirect, and you can try it for yourself

If you were to type in essexmax.co.uk/seo into a browser, it will redirect to a different page – in this example, to http://www.essexmax.co.uk/southend-seo-course-notes.html

The code to make that work, from the .htaccess file is:

Redirect 301 /seo http://www.essexmax.co.uk/southend-seo-course-notes.html

This translates to Permanently redirect any requests for the page /seo to the following web address

You can also use this command to redirect a folder, or even an entire site, to a new location.

There’s quite a lot to redirects and to .htaccess files, and this page is just a basic overview. If you’re after some more detailed information on how to do this correctly and safely, see the guide at http://301redirects.net/

he

Add A Comment