0

I have this site running on CodeIgniter and I have installed traq for issue tracking. Under public_html I have my application and system directory as well as an assets directory, and also traq. i.e.:

public_html
  ├── application
  ├── assets
  ├── system
  └── traq

My page works correctly, as well as the first login screen of traq, when I visit http://mywebpage.com/traq . When I visit any other page in traq, it does not work, it redirects to codeigniter and gives me 404. For instance when I login it tries to go to http://mywebpage.com/traq/login and fails with 404.

Here is my .htaccess file. Can someone please fix it or at least point me in the right direction?

<IfModule mod_rewrite.c>
    RewriteEngine On
    #RewriteBase /

    RewriteCond %{REQUEST_URI} ^ci_app.*
    RewriteRule ^(.*)$ index.php?/$1 [L]

    RewriteCond %{REQUEST_URI} ^traq.*
    RewriteRule ^traq(.*)$ traq/index.php/$1 [L]


    RewriteCond $1 !^(index\.php|humans\.txt|robots\.txt|assets|traq)
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
    ErrorDocument 404 /index.php
</IfModule>
alexg
  • 101
  • 4

1 Answers1

2
RewriteCond %{REQUEST_URI} ^traq.*
RewriteRule ^traq(.*)$ traq/index.php/$1 [L]

The request conditional should contain an absolute location since you're using the "start of line" anchor (^)! ^traq will not match /traq, ^/traq will. Fix this wherever you use the ^ anchor and you're golden.

priestjim
  • 669
  • 3
  • 8
  • Thanks, I appreciate it. It seems this is the solution, I'm getting some more errors which are probably unrelated. After work in the afternoon I'll verify that this works and accept your answer. – alexg Sep 15 '14 at 08:43
  • Oops turns out this was not the solution. When I go to `/traq/login` it redirects me to CodeIgniter's 404 page :( Thanks for the try though. I now officially hate `mod_rewrite`. – alexg Sep 15 '14 at 12:33