Here is a quick mod_rewrite example that forces www and redirects index.php to / (this fixes two canonicalization issues at one time).
?View Code PHPRewriteEngine on
RewriteCond %{HTTP_HOST} !^www.site.com$
RewriteRule ^/(.*)$ http://www.site.com/$1 [R=301]
RewriteRule ^/index\.php$ http://www.site.com/ [R=301,L]