0

I'm trying to use quercus to run codeigniter on tomcat.

I installed quercus in webapps/ROOT, then codeigniter in webapps/ROOT/appname.

I can access index.php in webapps/ROOT/appname, but if I try to access ROOT/appname/index.php/login/login, 404 errors occurred. I cannot even access ROOT/appname/welcome.

how do I resolve this 404 error?

I'm using codeigniter 2.x.


I used urlrewriterfilter to replace htaccess. But it seems it does not work. Following is my 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>
  • Codeigniter's routing with "pretty URLs" requires a .htaccess file with some rewrite rules in Apache HTTPD. Quercus does not support this .htaccess file. You'll need something like this instead: http://stackoverflow.com/questions/5920870/how-to-configure-tomcats-web-xml-with-my-front-controller – Sergiu Paraschiv Apr 22 '16 at 10:05
  • Thnks Sergiu. Unfortunately, the references dose not help. I also found out urlrewriterfilter, but couldn't find example to change codeigniter's htaccess to urlrewrite.xml –  Apr 25 '16 at 03:58
  • Codeigniter's htaccess is the one used by all frameworks that implement the front-end controller pattern. You should be OK with any urlrewrite.XML that redirects anything but existing files in the public folder to index.php. – Sergiu Paraschiv Apr 25 '16 at 05:55
  • It seems it does not work. I attached my urlrewrite.xml above. –  Apr 25 '16 at 09:22

1 Answers1

0

I found answer. I'm not quite sure whether it is about URL route or not. But the solutions was to put '?' after index.php. Long story short, I just did like as following: /appname/index.php?/login/login

Then it works!