开发者

What's wrong with this .htaccess rewrite

开发者 https://www.devze.com 2023-01-02 23:11 出处:网络
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\" :(

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

精彩评论

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