views:

25

answers:

1

Hi guys,

I spend a lot of time trying to figure out what's wrong with this .htaccess rewrite with no success. It produces a "500 Internal Server Error" :(

RewriteEngine On

RewriteCond %{REQUEST_URI} ^/(([^/]+/)*)gallery/
RewriteCond %{DOCUMENT_ROOT}%1gallery/cache/$0 -f
RewriteRule ^.+ cache/$0 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^.* index.php/$0 [L]

Can anyone see any problem?

Thanks in advance,
Constantin TOVISI

+1  A: 

I guess your second rule is causing this error. Try to exclude the target you are redirecting to:

RewriteCond $0 !^index\.php/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^.* index.php/$0 [L]
Gumbo