Forum Moderators: phranque
RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain.com [NC]
RewriteRule (.*) [domain.com...] [R=301,L]
RewriteCond %{THE_REQUEST} ^.*/index.html
RewriteRule ^(.*)index.html$ [domain.com...] [R=301,L]
In general, to avoid problems you should put your external redirect rules in order, from most-specific pattern to least-specific pattern, followed by your internal rewrite rules, again ordered from most-specific to least-specific pattern.
I also suggest the use of the more-robust pattern "^(([^/]+/)*)index\.html$" instead of "^(.*)index.html$" in that index redirect rule, making it:
RewriteCond %{THE_REQUEST} ^[A-Z]+\ /([^/]+/)*index\.html([#?][^\ ]*)?\ HTTP/
RewriteRule ^(([^/]+/)*)index\.html$ http://www.example.com/$1 [R=301,L]
Jim