Search Engine Friendly Redirection

Website redirection” means that when a user goes to one of your web pages, you automatically lead him to another site (or page). This is particularly useful if you have changed your domain name or site structure.

In, you would notice that I use this. If you go to the URL, you are actually redirected to Main is a folder in my public html. I put my content files in subfolders in order to keep my public_html directory neat, and to enable me to test an upgraded CMS before making it accessible to the public.

The old-school way of redirection was thru the infamous meta refresh tag. However, websites which contain this tag are already being tagged as spam by search engines.

A better alternative is to use a 301 or 302 redirect. These are called response codes. A more technical definition is available, but in a nutshell, if you use a 301 or a 302 redirect, you are just automatically directing your visitors to your new URL.

301 returns a user-agent response that your website has moved permanently to a new location. A 302, on the other hand, returns that your website has only moved temporarily.

What to use

There are a lot of arguments on 301 vs. 302. Some would favor one over the other, claiming that 302 should be strictly used for temporary locations, that 301 is preferred by search engines, etc. etc. However, from my own experience, it is most effective to use both.

Let’s say you have gotten a new domain name or URL.

First, submit this to Google’s index, but make sure that you retain your old domain (or URL) for the time being.

Then, put a 302 on your old domain name. That way, your old domain name and its rankings in Google are retained. Additionally, whenever someone clicks on a link which still has your old domain, because your server has a 302, it will automatically redirect them to your new domain name.

Wait a few months for your new domain name to “age” in Google. Aging is very important, and it usually takes 2 to 6 months, at the very least.

When your new site has aged satisfactorily, change your 302 redirects to a 301. This will transfer the page ranking of your old site to your new one in Google.

How to make the redirection

The most robust way of doing the redirection is thru .htaccess.

  1. Create a text file called .htaccess in your local PC.
  2. Put the following in this text file:

    Redirect 302 /

    Replace with your new domain name.

  3. Save your text file.
  4. Upload this file in your old domain name’s public_html.

If you only want to redirect users to another directory, try this more convenient method thru PHP:

  1. Create a file with the same filename as your old web page file (index.php, default.php, etc.)
  2. Enter the following lines:


    header("Status: 301 Found");
    header("Location: main");

  3. Upload this file in your directory.

7 thoughts on “Search Engine Friendly Redirection”

  1. Chette, I was wondering why you dont seem to write about SEO a lot. You have nice google positions and seem to know something. Could you share some of your tips.

Leave a Reply

Your email address will not be published. Required fields are marked *