CodeIgniter Forums
Routing Question - 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: Routing Question (/showthread.php?tid=22412)



Routing Question - El Forum - 09-08-2009

[eluser]Unknown[/eluser]
Hello,

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 http://mysite.com/admin, 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

[eluser]brianw1975[/eluser]
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.
Code:
$route['default_controller'] = "main";

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



Routing Question - El Forum - 09-08-2009

[eluser]bretticus[/eluser]
Sorry, wrong thread. Couldn't delete this response...