Lets keep it simple.

Every once in a while you must have come across the term “301 redirects” at webmaster boards, SEO discussions and while talking about website development. Like most of you all I too was totally confused and gave up on understanding it, thinking that it was nothing more than a technical jargon.

301 redirects or permanent redirects are a topic that we all need to understand as it does have an implication in relation to SEO and the SERPs and can also be of use when we move the pages or the website around.

So now that I know what these things are, I though best to share.

In this post I hope to explain the concept of these redirects and the implication they have on site development.

Let us first understand the meaning of a permanent 301 redirect.

A 301 permanent redirect informs a browser and a Search Engine spider that a website or a web page has been moved permanently from the previous address to a new location and whenever the old url is accessed in the browser, the redirect code will automatically open the new website location.

In terms of SEO, a search engine will pass the benefits of a old page to a new page whenever it is informed of a permanent redirect. These benefits include the passing of Google PageRank and also the Anchor Text rankings of the “Old Page” to the “New Page”.

Setting up a 301 redirect

The best posible way to setup a 301 redirect is via your.htaccess file. The beauty of this file is that you can override the server settings and all you need is a FTP access to your webhost.
You can create a .htaccess file as a notepad file. While saving the file, save it as .htaccess and you are ready to start redirecting.

This .htaccess method of redirection works only on Linux servers having the Apache Mod-Rewrite moduled enabled.

Remember that your .htaccess file should be ideally place at the root directory of your webhost or within the directory where you would like the redirect to take place.

Lets first learn to redirect a single page.

Say for example I had a very important page http://www.kiviniar.com/iRock.php and now have moved the page to a new url http://www.kiviniar.com/we-Rock.php. Now I have to write a redirect to tell the browser and the SE bots that the page has been moved.

So the code for that would be: (p.s.You can create or edit your .htaccess file in notepad)

RewriteEngine On
Redirect 301 /iRock.php http://www.kiviniar.com/we-Rock.php

Once you have created the file, you have to upload it to your root folder for the redirect to work.

So now when you open http://www.kiviniar.com/iRock.php, it will automatically be redirected to http://www.kiviniar.com/we-Rock.php

Now if you would like to redirect the old page in a case where you have changed the domain name itself.

Then this is what you would need to add to your .htaccess file.

RewriteEngine On
Redirect 301 /iRock.php http://www.website.com/iRock.php

In this case, when we open http://www.kiviniar.com/iRock.php, the browser will be redirected to the new site http://www.website.com/iRock.php

The problem of canonicalization and duplicate content.

Read more about canonicalization


Fixing the canonicalization problem via 301 redirects

This code in your .htacess file will help you solve the canonicalization problem for your website.

First you must decide what format you want your web pages to be accessed as. In this case you have two options that you can use, one with the www (eg.http://www.kiviniar.com/) or without the www (eg.http://kiviniar.com).

If you wish to see your pages with only the www, then use this code in your .htaccess file for the redirect to work.

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.kiviniar\.com$
RewriteRule (.*) http://www.kiviniar.com/$1 [R=301,L]

Once again to have the redirect in place you will need to upload your modified .htaccess file to the root directory of your webhost (the same place where your website files are stored).

Once the file is in place, anytime you try to access http://kiviniar.com you will be automatically redirected to http://www.kiviniar.com. This would hold good for any page within the website.

If you wish to see your pages without the www, then use this code in your .htaccess file for the redirect.

RewriteEngine On
RewriteCond %{HTTP_HOST} !^kiviniar\.com$
RewriteRule (.*) http://kiviniar.com/$1 [R=301,L]

Once the file is in place, anytime you try to access http://www.kiviniar.com you will be automatically redirected to http://kiviniar.com. This would hold good for any page within the website.

Lastly I would cover the scenario where you would like to switch domain names and move the complete site to a new domain.

Now if you want the www in your page url, then add this code in your .htaccess and upload the file in the root directory of your OLD DOMAIN.

Note: In this case the old domain is http://www.kiviniar.com and the new domain is http://www.exploreurls.com

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.kiviniar\.com$
RewriteRule (.*) http://www.exploreurls.com/$1 [R=301,L]
RewriteCond %{HTTP_HOST} !^kiviniar\.com$
RewriteRule (.*) http://www.exploreurls.com/$1 [R=301,L]

Or if you donot want the www in your page url, use this code to make the redirect.

RewriteEngine On
RewriteCond %{HTTP_HOST} !^kiviniar\.com$
RewriteRule (.*) http://exploreurl.com/$1 [R=301,L]
RewriteCond %{HTTP_HOST} !^www\.kiviniar\.com$
RewriteRule (.*) http://exploreurls.com/$1 [R=301,L]

Whenever someone tries to access the old pages, they will be automatically be redirected to the new site.

Remember that this holds good for the Search Engines Bot as well and not only the human trying to access your old website.

The 301 permanent redirect will ensure that the search engine bots are informed that your site has moved permanently and as a result the PR and the SERP benefit will be passed on from the old site/pages to the new site/pages.

That’s All Folks

Hope this post was helpful and will be of use sometime.

First written for: Kiviniar

1 Star2 Stars3 Stars4 Stars5 Stars (4 votes, average: 5 out of 5)
Loading ... Loading ...