Apache: Error 404 while filepermissions set to 777

Remove the comment from that line, otherwise all directives in your .htaccess between <IfModule mod_rewrite.c> and </IfModule> are ignored.

Possibly, you need to adapt the If... directives to your version of apache httpd.