CodeIgniter Forums
default_controller gives 404 - Printable Version

+- CodeIgniter Forums (
+-- Forum: Archived Discussions (
+--- Forum: Archived Development & Programming (
+--- Thread: default_controller gives 404 (/thread-12085.html)

default_controller gives 404 - El Forum - 10-05-2008

Hi, my routes.php looks like this:
$route = array(
                 "default_controller"  => "c_Home", // 404
                 "scaffolding_trigger" => "",
                 "home"       => "c_Home",  // works
                 "tag/:any"  => "c_Tag/view",
                 "tags"        => "c_Tag/all"

As stated in the comments, my default_controller, that is visiting the site's domain, gives a CI generated 404. Visiting /home/ however takes me to the right page.

I've tried changing the URI protocol to the various options but no cigar.

I'm running CodeIgniter 1.6.3 on PHP5 and Apache 2.0.55 on Ubuntu 6.06.

Any ideas?

default_controller gives 404 - El Forum - 10-06-2008

Do you have something overwriting it in your .htaccess file that you maybe forgot about?

I don't see any other way to cause two different results when pointing to the same controller (at least that I can think of off the top of my head).

default_controller gives 404 - El Forum - 10-06-2008

Both renaming .htaccess to something else, and turning off the RewriteEngine, make no difference.

I have been checking my controller's code, and none of the code loads a different view based on the URI. It always loads the same view, but only succeeds when visiting /home/.

Is there some way to get a more specific reason for a 404? 'cause I know it can mean that either a view couldn't be found or the controller wasn't pointed to correctly.

default_controller gives 404 - El Forum - 10-06-2008

I did some digging and luckily I've fixed it.

The destination value for $route['default_controller'] must be in lowercase, as well as the filename of the controller it points to.

This is unlike any other entry in $route.