2010年

[CakePHP] さくらのレンタルサーバで CakePHP1.2.6 が動かない このエントリーを含むはてなブックマーク

CakePHP Add comments

CakePHP 1.2.6 をさくらのレンタルサーバに設置したところ、Internal Server Error になってしまった。トップページは表示されるが、コントローラを指定すると Internal Server Error になってしまう。エラーログを見ると、

mod_rewrite: maximum number of internal redirects reached.
Assuming configuration error.
Use 'RewriteOptions MaxRedirects' to increase the limit if neccessary.

と出ている。ちなみにドキュメントルートは app/webroot にしていました。

1.2.5 と 1.2.6 の webroot/.htaccess を比較すると “RewriteBase /” の指定が 1.2.5 にはあるが、1.2.6 ではなくなっている。
これを追加すると動作するようになりました。

最終的には以下のような .htaccess です。

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
</IfModule>

他のサーバで同じコードで試してみたが、さくら以外では動作しました。

関連する投稿

Leave a Reply

Additional comments powered by BackType

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS ログイン