I am VERY well aware that the RewriteEngine On command is at the beginning.
What I am suggesting you try, based on me having he same issue, is putting the RewriteEngine On command before every different set of rules.
The first set of rules here will redirect yoursite.com to
www.yoursite.com.
The second set will redirect all yoursite.com/index requests to yoursite.com/
Both of these will help you avoid duplicate content penalties.
Code:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.yoursite\.com$ [NC]
RewriteRule ^(.*)$ http://www.yoursite.com/$1 [L,R=301]
RewriteEngine on
# index.php to /
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*index\.php\ HTTP/
RewriteRule ^(.*)index\.php$ /$1 [R=301,L]
RewriteEngine on
Redirect 301 /folder http://www.yoursite.com/folder
Redirect 301 /folder http://www.yoursite.com/folder