WWW or Not: That is the Question?

Posted in Apache, SEO | By LGR | On February 20th, 2007

Most people don’t realize that there website can found by using both www.mywebsite.com and mywebsite.com. Why is this important? The search engines will index both the www site and the non-www site, providing the search engine an identical set of pages which could lead to a penalty. While most search engines will eventually sort this out why wait for them to do it. Don’t give them a choice in what they index.

Create a .htaccess file and place it on the web root folder. Include the following lines of code:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^mywebsite\.com$ [NC]
RewriteRule ^(.*)$ http://www.mywebsite.com/$1 [R=301,L]

This will redirect all requests for pages at mywebsite.com to www.mywebsite.com giving only one copy of your website for the search engines to index. Give it a try on this blog. All requests to blog.lgr.ca are redirected to www.blog.lgr.ca.

Similar Posts:

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • StumbleUpon
  • email
  • FriendFeed
  • Reddit
  • RSS
  • Twitter
  1. [...] same as http://www.mydomain.com and only reports back one of the site. I would still recommend you use an htaccess redirect for the other search engines [...]

Leave a Reply

COMMENT


My Comment Policy: I moderate comments. Please be patient:

  • Spam will happily be destroyed.
  • Use your real name, not some keywords. Otherwise it will be destroyed.
  • Mean comments aren't necessary.
  • Lewd comments will be edited, I don't want my readers leaving because of offensive content.
  • Great debate, ideas, criticism and colorful commentary is always appreciated and approved!
«
»