If you would like to force all your incoming URLs to have www at the front for SEO reasons, create an .htaccess file with the following content in the root directory of your website.
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example.com [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
What is 301 redirect?
301 redirect is the most efficient and Search Engine Friendly method for webpage redirection. It's not that hard to implement and it should preserve your search engine rankings for that particular page. If you have to change file names or move pages around, it's the safest option. The code "301" is interpreted as "moved permanently".
Source: How to Redirect a Web Page
Recommend Book
[tags]301 redirect, htaccess, search engines, seo[/tags]
Nice summary. I wrote a slightly more detailed version on my personal blog – http://www.web-design-talk.co.uk/20/301-redirects-for-seo-using-htaccess/