CodeIgniter Forums
Problem with admin routes - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Problem with admin routes (/thread-9778.html)



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

[eluser]nuts[/eluser]
Hello,

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
Code:
$route['/(.+?)(/admin_)(.+?)/'] = "admin/$1/$2";

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

Thanks,

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


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

[eluser]CodyPChristian[/eluser]
So you're wanting a setup like:

domain/admin/admin_controllers?

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

Code:
$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.

Cheers!

p.s. Welcome to the forums


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

[eluser]nuts[/eluser]
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