CodeIgniter Forums
Routing Question - Printable Version

+- CodeIgniter Forums (
+-- Forum: Archived Discussions (
+--- Forum: Archived Development & Programming (
+--- Thread: Routing Question (/thread-22412.html)

Routing Question - El Forum - 09-08-2009


Right now, in my routing.php file I have:

$route[':any'] = 'main/index';

So, this calls to the main class, index function and serves basically as a template.

Although, in my controller folder I have a folder 'admin' with a Home class and other classes.
Before I put in the :any exception, and I went to, it would pull up classes how it was supposed to. After I put it in, going to that url just throws a 404.

Help would be appriciated,
Thanks in advance!

- Mike

Routing Question - El Forum - 09-08-2009

well, 1st, there is no need to put index in the route - the index function is called by default in every controller, unless you are trying to override the _remap function, which i don't know if that is possible.

2nd, in route.php set "main" as your default controller -- this should already be in there anyways.
$route['default_controller'] = "main";

remove your route from routes.php because it's redundant and obviously screwing up your admin section
$route[’:any’] = ‘main/index’;

Routing Question - El Forum - 09-08-2009

Sorry, wrong thread. Couldn't delete this response...