Thursday, July 30, 2009

How to do 301 Redirect (Permanent Redirection)?



301 Redirect In my previous post 301 Redirect: Why 301 Redirect (Permanent Redirection) Is Important? I have explained about the importance of 301 redirection in SEO.

Now its time to know how we can do the 301 redirect for our website.

How to do 301 redirect?
There are two possible ways to do 301 redirect, which depends on the type of web server - Apache or IIS (Microsoft) - that you’re running.

Open a notepad and paste the below mentioned lines.

RewriteEngine on

RewriteCond %{HTTP_HOST} ^yourdomain\.com
RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [R=301,L]
In place of 'yourdomain' please use your domain name.
If you want your site with non-www version, paste the below mentioned lines.
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.yourdomain\.com
RewriteRule ^(.*)$ http://yourdomain.com/$1 [R=301,L]

Again here, in place of ‘yourdomain’ mention your domain name.

Now save the file as .htaccess. Place the .htaccess file into your root folder where your site index file is. That’s it. You have done it!

IIS Server (Microsoft) : You have to create two websites in the IIS configuration. The first one will the primary domain and the second one will be redirecting to the primary.

  • Log in as an Administrator and choose:
  • Start >> Programs >> Administrative Tools >> Internet Services Manager.
  • Choose the server which is hosting your primary domain.
  • Right click on the site you want to redirect FROM and choose Properties > Home Directory. You will see


Server Control Panel

  • Select the radio button "a redirection to a URL".
  • In the “Redirect to:” field, enter the domain you want to redirect to. For example, if you want to redirect to www.yourdomain.com, enter http://www.yourdomain.com in this field.
  • In the “The Client will be sent to” field, select “A permanent redirection for this resource.” This will create a 301 redirect from your primary domain to yoursite.com.
  • Now click on ‘Apply’. That’s it.


We have done with 301 redirect for our website. Now how to track the visits receiving from redirected domain. My next post will carry the details about how to track the visits coming from redirected domain. If you want receive the latest updates from the blog please subscribe for the blog!

If you find this post more useful then, Please

Subscribe to this Blog:

Click here to Subscribe to FREE email updates from "Internet Marketing Insights"

Stumble ThisFav This With TechnoratiAdd To Del.icio.usDigg ThisAdd To RedditAdd To FacebookAdd To Yahoo

People who read this post also read :





0 comments:

 

Creative Commons License

Blog directory Internet Marketing Insights - Blogged Internet Blogs - Blog Catalog Blog Directory