What's wrong with this .htaccess rewrite
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}%1gal开发者_运维技巧lery/cache/$0 -f
RewriteRule ^.+ cache/$0 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^.* index.php/$0 [L]
Can anyone see any problem?
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]
精彩评论