EllisLab text mark
Advanced Search
     
Confusion - routing related
Posted: 06 July 2007 03:10 PM   [ Ignore ]
Joined: 2007-07-06
1 posts

Maybe I’m missing something simple, but I’m having a problem and was hoping someone could help.

A general description of the problem
I’m getting CodeIgniter’s 404 error page no matter what

On closer inspection

My “logs” directory contains a file that says:

DEBUG - 2007-07-06 11:00:25—> Config Class Initialized
DEBUG - 2007-07-06 11:00:25—> Hooks Class Initialized
DEBUG - 2007-07-06 11:00:25—> No URI present. Default controller set.
DEBUG - 2007-07-06 11:00:25—> Router Class Initialized
DEBUG - 2007-07-06 11:00:25—> Output Class Initialized
DEBUG - 2007-07-06 11:00:25—> Input Class Initialized
DEBUG - 2007-07-06 11:00:25—> Global POST and COOKIE data sanitized
DEBUG - 2007-07-06 11:00:25—> URI Class Initialized
DEBUG - 2007-07-06 11:00:25—> Language Class Initialized
ERROR - 2007-07-06 11:00:25—> 404 Page Not Found—>

This happens whether I go to the default directory (mapping to index), to the default controller set up in routs or to any “directory” representing a valid controller or not.

The only non-standard things are that I have hooks (filters) enabled and my .htaccess file isn’t as described in the documentation (I get a server config problem if I do it just as the docs say). It is set up:

Options FollowSymlinks
RewriteEngine on

RewriteCond 
%{REQUEST_FILENAME} !-f
RewriteRule 
^(.*)$ index.php?$1 [L] 

But for CI to be using the CI 404, it has to be working.

Any tips?

 
Posted: 06 July 2007 03:36 PM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Avatar
Joined: 2006-06-23
370 posts

Does accessing the url with “index.php” intact work? Is it just when you try to remove index.php from the url that this happen?

I use the same approach that you do, but I also include the following condition to check existence of directories:

RewriteCond %{REQUEST_FILENAME} !-
 Signature 

Mac OS X 10.8, Apache 2.x, NGiNX, PHP 5.4.x, CodeIgniter 1.7.2/2.1.3

 
Posted: 06 July 2007 03:38 PM   [ Ignore ]   [ # 2 ]   [ Rating: 0 ]
Avatar
Joined: 2006-06-23
370 posts

Here’s a full RewriteRule from one of my sites (same on all of my sites):

<IfModule mod_rewrite.c>
    
Options +FollowSymLinks
    RewriteEngine on
    RewriteBase 
/
    
RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond 
%{REQUEST_FILENAME} !-d
    RewriteRule 
^(.*)$ index.php/$1 [QSA,L]
</IfModule
 Signature 

Mac OS X 10.8, Apache 2.x, NGiNX, PHP 5.4.x, CodeIgniter 1.7.2/2.1.3