g1smd - 10:40 pm on Nov 27, 2012 (gmt 0)
Get the ErrorDocument as the very first or very last line, not in the middle of all your RewriteRules.
RewriteBase / is the default and not needed to be stated.
The index redirect ruleset must be listed before the non-www/www redirect ruleset.
If you comment out a RewriteRule, the two conditions before it will apply to the next RewriteRule found in your htaccess file - unless you comment out the conditions too.