Custom Php and .htaccess RewriteEngine On(500 error)

Hi guys!

in my .htaccess i have:

[php]#— DH-PHP handlers —
Options +ExecCGI
AddHandler fastcgi-script fcg fcgi fpl
AddHandler php-fastcgi .php
Action php-fastcgi /cgi-bin/dispatch.fcgi

Options +FollowSymLinks

RewriteEngine On

Get rid of index.php

RewriteCond %{REQUEST_URI} /index.php
RewriteRule (.*) index.php?rewrite=2 [L,QSA]

Rewrite all directory-looking urls

RewriteCond %{REQUEST_URI} /$
RewriteRule (.*) index.php?rewrite=1 [L,QSA]

Try to route missing files

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} public/ [OR]
RewriteCond %{REQUEST_FILENAME} .(jpg|gif|png|ico|flv|htm|html|php|css|js)$
RewriteRule . - [L]

If the file doesn’t exist, rewrite to index

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?rewrite=1 [L,QSA]

sends requests /index.php/path/to/module/ to “index.php”

AcceptPathInfo On

@todo This may not be effective in some cases

FileETag Size[/php]

without the mod_rewrite lines works fine. This is the error when i use mod_rewrite:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

Probably is an error in the .htaccess config, but I can’t solved it.

Thanks a lot and sorry by mi english…