私はquercusを使ってtomcatでcodeigniterを実行しようとしています。コードネームがキュルカスで404エラーを示しています
webapps/ROOTにquercusをインストールしてから、webapps/ROOT/appnameにcodeigniterをインストールしました。
webapps/ROOT/appnameのindex.phpにアクセスできますが、ROOT/appname/index.php/login/loginにアクセスしようとすると404エラーが発生しました。私はROOT/appname/welcomeにアクセスすることすらできません。
この404エラーを解決するにはどうすればよいですか?
私はcodeigniter 2.xを使用しています。
私はurlrewriterfilterを使用してhtaccessを置き換えました。しかし、それは動作しないようです。 以下は私のurlrewrite.xmlです。
<urlrewrite>
<rule>
<name>Generic Pretty URLs Pass-through</name>
<condition type="request-uri" operator="notequal">^/(robots.txt|osd.xml|flex2gateway|cfide|cfformgateway|railo-context|admin-context|files|images|jrunscripts|javascripts|miscellaneous|stylesheets)</condition>
<condition type="request-uri" operator="notequal">\.(bmp|gif|jpe?g|png|css|js|txt|xls|ico|swf|woff|ttf|otf)$</condition>
<condition type="request-filename" operator="notdir"/>
<condition type="request-filename" operator="notfile"/>
<from>(.*)</from>
<to type="passthrough" last="true">index.php/$1</to>
</rule>
</urlrewrite>
「pretty URLs」を使用したCodeigniterのルーティングでは、Apache HTTPDで書き換えルールを持つ.htaccessファイルが必要です。 Quercusはこの.htaccessファイルをサポートしていません。代わりに、次のようなものが必要になります:http://stackoverflow.com/questions/5920870/how-to-configure-tomcats-web-xml-with-my-front-controller –
Thnks Sergiu。残念ながら、参考文献は役に立たない。私もurlrewriterfilterを見つけましたが、codeigniterのhtaccessをurlrewrite.xmlに変更する例は見つかりませんでした。 – Kims
Codeigniterのhtaccessは、フロントエンドコントローラパターンを実装しているすべてのフレームワークで使用されています。パブリックフォルダ内の既存のファイルを除くすべてのファイルをindex.phpにリダイレクトするurlrewrite.XMLを使用しても問題ありません。 –