I would post this in the original thread http://www.sitepoint.com/forums/show...es-code-please - which would help future users much more - but someone closed it. Here is the code Jeff gave me. Works perfect except it prevents me from loging into my forum backend for some reason. Took me 15 hours to figure that out. OMG. I tried to give a exclusion to the forum folder but I must not of been doing it right because I couldnt get it to work.

So two questions? Why would this break my forum login? And two, can I make it exclude the forum located at www.site.com/forum/? Doing so I would assume all would function correctly again. FYI using my old and much larger rewrite the login works. Thanks.

Code:
# Rewrite index.html/php to folder
RewriteRule ^(.*/)?index\.(html?|php)$ /$1 [R=301,L]

# Rewrite non-www (non-canonical) to www
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule (.*) http://www.%{HTTP_HOST}/$1 [R=301,L]