How 301 Redirect helps your SEO

Moving your website can be really challenging especially when you’re dealing with SEO, if you’re not careful you’ll end up losing your position on Google’s Page Ranking. Surely you don’t want to start again from square one, and waste the months and years you have already invested to get to where you are right now.

Search Engines indexed your entire site and if you move or rename it without considering the right options you’ll run the risk of losing a lot of traffic and getting the infamous “Error 404 – file not found” link.

The best way to go about this is the 301 redirect.

What about other ways you say? Well let’s take a look at some other ways and why we don’t consider it to be a best option in this article.

Creating a Custom Error Page

But here is the catch;

1. Since Search engine spiders index your site all the time and if it doesn’t see your old content you lose all the keywords tied up to that page. It will take some time before search engine get to crawl deeper in to the pages.

b) This is going to suck for the visitors that they have to click links after links to get to the right content.

Creating Meta Refresh

A meta refresh can be implemented by having an empty page and putting the following code between your <head> elements.

<HEAD>
<META HTTP-EQUIV=”refresh” content=”0;URL=http://www.new.com/new.htm”>
<META CONTENT=”NOINDEX, NOFOLLOW”>
<TITLE>Page has moved</TITLE>
</HEAD>

What’s the catch?

Be very careful when using this since it’s a technique often used by spammers to trick search engines and what they do is create a page that is optimized for certain keywords and phrases -but usually the page has no real content. The page is then picked up by some search engines, but when a visitor clicks on the search engine entry, they are redirected to another site, often unrelated. You then run the risk of being banned or blocked by major search engines.

You can provide “ROBOTS” statement in the code example above which tells search engines to ignore this page, a safeguard against copping a slap from the engine.

htaccess 301 Redirect

A 301 redirect is the most efficient and spider/visitor friendly strategy around for web sites that are hosted on servers running Apache (check with your hosting service if you have any issues implementing this).  Creating a “301” means that your site has “moved permanently”.

It’s not that hard to do and best of all, it preserves your search engine rankings. And if you have to change file names or move pages around, it’s your safest option.

A 301 redirect is implemented in your .htaccess file (only on linux box)

301 redirect for Static pages how-to

Download the .htaccess from your root directory, in case your isp don’t have one you can always create one on the fly. Using your notepad create a file called .htaccess (save it as .htaccess without any extensions)

If you have existing one, download it and scroll down past all the existing code, leave a line space, then create a new line that follows this example:

redirect 301 /old/old.htm http://www.you.com/new.htm

That’s it. Save your file, and upload it (back) into your web root and test it out by typing in the old address on your url bar.  You should be instantly and seamlessly transported to the new location.

301 redirect for dynamic pages how-to

A dynamic page are pages that are generated by a data driven application, such as cms, blog systems etc.

http://www.yoursite.com/page.php?id=13

Where a query string is used, the 301 redirect solution for static pages above will not work; you’ll need to use a rewrite solution. Using the page.php?id=13 example, here’s what you’ll need to use in your htaccess file:

RewriteEngine on
RewriteCond %{QUERY_STRING} ^id=13$
RewriteRule ^/page.php$ http://www.example.com/newname.htm? [L,R=301]

In our example above the should be replaced with the query string of the page you wish to redirect and the page.php with the name of your file prior to the query string.

So there it is, the next time you think about moving your site or file consider implementing the 301 redirect and for more powerful use of redirects check out mod_rewrite.

SEO effort can be challenging and a lot of trial and errors but you know the right tool and techniques you maximize your time well and get more positive results.

Here is a little video tutorial on 301 Redirect: