Comment on 301 Redirect Htaccess by Cassie.

301 Redirect Htaccess I. Am. Lost. Please help!

I created a .htaccess document and place it in my root folder. I am trying to accomplish two things.

1, get rid of the .html at the end of every page
2, redirect from www to non www.
3, redirect index.com to the root directory.

I haven’t been able to accomplish any of those things.

Here is my code:

DirectoryIndex index.html index.asp index.htm index.php
RewriteEngine On
Redirect 301 /index.html http://www.domain.com/
RewriteEngine On
RewriteCond %{HTTP_HOST}!^domain.com$
RewriteRule (.*)http://domain.com/$1 
[R=301,L]

Can someone please help me figure this out?

Thanks!