Welcome Guest, Not a member yet? Register   Sign In
Problem with admin routes


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:

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

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

Theme © iAndrew 2016 - Forum software by © MyBB