さくらのApacheが2.2になりzf1のプロジェクトの.htaccessのrewriteが効かない
さくらのレンタルサーバ(スタンダード)のapacheが1.3から2.2にバージョンアップしてから、Zend Framework1系のプロジェクトのルーティングが効かなくなりました。
ルーティングが効いていないということは、.htaccessしか原因が考えられないので、
いろいろためしたのですが、apacheのログに
Negotiation: discovered file(s) matching request: ....
という見慣れないエラーが。
これをキーワードにググった結果、
以下の記事に
Vinay's Blog: Apache: Negotiation: Discovered File(s) Matching Request: None Could Be Negotiated
AddType application/x-httpd-php .php
と加える必要ありとのことなので試したら無事動きました。
最終的な.htaccessは以下の通り。
AddType application/x-httpd-php .php RewriteEngine on RewriteBase / RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L] RewriteRule ^.*$ index.php [NC,L]
同じサーバー上で動いているZend Framework 2のプロジェクトは、何の影響もなかったのが謎です。