0

我正在尝试使用 quercus 在 tomcat 上运行 codeigniter。

我在 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>
4

1 回答 1

0

我找到了答案。我不太确定它是否与 URL 路由有关。但解决方案是把'?在 index.php 之后。长话短说,我只是喜欢以下内容:/appname/index.php?/login/login

然后它工作!

于 2016-05-02T03:15:30.420 回答