Create or open up your .htaccess file in the domain's root directory. Add the following, remembering to replace domain.com:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain\.com$ [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]
Now all requests will include the www. part of the url. Doesn't affect subdomains. It will also help consolidate google pagerank. You can also use the following instead if you want to do the above plus redirect domain.com/index.php to domain.com. This further helps reduce pagerank leakage:
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^index\.php$
http://www.domain.com/ [R=301,L]
RewriteCond %{HTTP_HOST} ^domain\.com$ [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]