“301″ Redirects for SEO

January 4th, 2008

Search engines will often regard www.example.com and example.com as two different websites. Because of this, websites usually experience the effects of link fragmentation (inbound links point to both www.example.com and others to example.com). For example, if www.example.com has 5,000 inbound links and example.com has 2,500 inbound links you could potentially combine them so you have all 7,500 links pointing to www.example.com.

To do this you can setup a permanent “301″ redirect by creating a .htaccess file with the below code. This will ensure that all requests coming in to example.com will get redirected to www.example.com.

Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^example.com [nc]
rewriterule ^(.*)$ http://www.example.com/$1 [r=301,nc]

Notes:

  • The .htaccess file needs to be placed in the root directory of your old website (i.e the same directory where your index file is placed)
  • REPLACE example.com and www.example.com with your actual domain name in the code above
  • This .htaccess redirection method only works on servers using the Apache Mod-Rewrite module

This “301″ redirect method is also a great way to save money on SSL certificates. When the site always points to www.example.com you only need to buy a single SSL certificate.

Posted in Website Design. ⋅ Tags: .htaccess, redirects, SEO, SSL

7 Responses to ““301″ Redirects for SEO”

  1. January 14, 2008 at 6:54 AM

    It is really very helpful in terms of SEO. Great article Sir!

  2. January 22, 2008 at 7:27 AM

    Hi,

    Nice post on 301 redirect, i like the post and importance of redirecting ages through this method. i m confused if i use refresh command then will it not work.

  3. January 22, 2008 at 12:05 PM

    @Sunita

    The site is redirected on the server side, so refreshing the browser wouldn’t matter.

  4. January 23, 2008 at 8:32 AM

    I remember using 301 redirect on my client’s site before. It is really a big help on SEO. But of course, you should know when is the right time to use it. :) Thanks for the information.

  5. March 23, 2008 at 10:42 PM

    does anyone knows if there is any other information about this subject in other languages?

  6. April 25, 2009 at 3:06 PM

    I strongly recommend that you turn the No Follow off in your comment section.

    I’ll watch Google Webmaster Tools, and if the links don’t show up after a couple of weeks — I won’t go back to that blog again.

    Another suggestion: you should have a Top Commentator widget installed.

    Do Follow and Top Commentator will ensure that you have a successful blog with lots of readers!

  7. November 9, 2009 at 2:06 AM

    seriously, this blog is sick . I think im gonna stick around and read about 6 more of your posts. Later

Leave a Reply

About this Blog…

Hello, welcome to the “company” blog. Owned and operated by Matthew Ginop, MCGWD is a small website design company located in northern lower Michigan. I provide affordable sites using web standards and semantic markup.

Blog Post Categories