If SEO matters to you, then go for
www.example.com because other people who link to you are likely to use that format. When I built my first two sites I thought I was being cute and trendy by dropping the www, but when I learnt SEO, I realised the mistake and much later I learnt how to make a .htaccess file (used by most websites that use an Apache server) and place it in the root directory.
Code:
RewriteEngine on
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]*/)*index\.html? [NC]
RewriteRule ^(([^/]*/)*)index\.html?$ http://www.example.com/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^example\.com [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
The first rewrite rule rewrites all index pages, both index.html and index.htm to "/ " for both non-www and www, and shows them all to be with a "
www." prefix. The redirect works for index pages both in the root and in any folders, and the 301 redirect preserves the folder name in the redirect.
All non-www pages are made to appear as www. by the second rewrite rule. This second directive is never used by index pages as the first directive will have already converted all of them.
Here is another way to do the same thing, except that it converts links to "example.com" and "example.com/" to "www.example.com/".
Code:
Options +Indexes
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example\.com
RewriteRule ^(.*)$ http://www. example.com/$1 [R=permanent,L]
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*)$ http://www. example.com/$1/ [L,R=301]
This should be a text file, and saved as .htaccess (dot at the beginning) in the home page directory. So, when someone links to you without a www, it is presumed to be there. This matters to search engines for pagerank purposes. If you didn't bother to do this and got some links to www and some without the www, then you could see different PR values for the two versions of the URL. This script helps you to collect all link juice to the preferred domain.
For Google only, through Webmaster Tools you can designate either version to be the canonical (authoritative) version, so the .htaccess file is not necessary, but it won't help with other search engines.
Some hosting companies have changed server settings so that you can't see dot files (such as .htaccess) but they are there. Once you have uploaded one, you won't see it at the other end. Be sure to keep a copy on your PC in case you need to edit it.