开发者

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]
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜