CodeIgniter Forums
Problem with admin routes - Printable Version

+- CodeIgniter Forums (
+-- Forum: Archived Discussions (
+--- Forum: Archived Development & Programming (
+--- Thread: Problem with admin routes (/thread-9778.html)

Problem with admin routes - El Forum - 07-08-2008


I started with CodeIgniter few days ago, and I've found this framework very interesting.

But I encounter a problem with my routes, I want to make /controller/admin_action accessible by /admin/controller/action

I tried
$route['/(.+?)(/admin_)(.+?)/'] = "admin/$1/$2";

But It's not working, can someone help me ? :-)


Ps: Sorry if I have not a good english :red:

Problem with admin routes - El Forum - 07-08-2008

So you're wanting a setup like:


if so make your 'admin' a directory and put your controllers inside, then just map that path to the first controller

$route['admin'] = "admin/admin";

You can also do domain/admin_controller/functions, doing this though is going to make a very large controller, I think you would be better off with the first layout.


p.s. Welcome to the forums

Problem with admin routes - El Forum - 07-08-2008

Ok it's working thanks for your help, it's not exactly what I wanted but that's convenient for my use.

p.s. I think it's the first but not the last time I ask question :p