Sunday, December 10, 2006

Code to 301 Reirect Your Web Page

Hello Friends,

For Google, every web page is a seperate but the most important page of any website is its home page. Almost every search engine follow redirection techniques. Out of many redirection techniques, 301 is treated a search engine friendly and its one of the important tool for any search engine optimization professional.
So, I (Amit Dobhal) am giving you the code for 301 redirection. This code is to redirect example.com to www.example .com. As I told earlier google treat every web page a separate page.
Google consider these web pages as seperate URLs and treat them seperately.

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

Now, just copy the above code open a new blank file and paste this code. Save this file with name .htaccess under "All Files". Put this file at root location of the server.
Almost every search engine follow this file, however there are cases were I saw MSN not following it. But good thing is it works perfectly for GOOGLE.