CodeIgniter Forums
Error with 404 Routing - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Error with 404 Routing (/showthread.php?tid=44858)



Error with 404 Routing - El Forum - 08-29-2011

[eluser]AeroCross[/eluser]
Good morning, fellow Codeigniters,

I'm having a issue with the $route['404_override'] variable. Suppose that I have a controller "home.php" that has an index() method, and a about() method. I also have a "sitemap.php" controller that has an index() method and a missing() method.

If I set $route['404_override'] = 'sitemap/missing'; and enter http://localhost/ci/asd, http://localhost/ci/asd/asd, http://localhost/ci/asd/asd/asd/asd and so on, the override works.

If I enter http://localhost/ci/about/asd (meaning that the controller exists), I get this error:

A PHP Error was encountered

Severity: Notice
Message: Undefined property: CI_Loader::$session
Filename: views/missing.php
Line Number: 4

Fatal error: Call to a member function userdata() on a non-object in application/views/missing.php on line 4

If I use $ci =& get_instance();, it still breaks.

Any thoughts on what this could be?