how to create Codeigniter route that doesn't override the other controller routes?

Posted by bakazero on Stack Overflow See other posts from Stack Overflow or by bakazero
Published on 2010-03-28T10:47:53Z Indexed on 2010/03/28 10:53 UTC
Read the original article Hit count: 228

Filed under:
|

I've got a lot controller in my Codeigniter apps, ex: Signup, Profile, Main, etc..

Now I want to build "User" controller.

what I want:

  • if people goes to url: example.com/signup, I want use default route to "Signup" Controller
  • if people goes to url: example.com/bobby.ariffin, I want to reroute this to "User" Controller because the url not handled by any Controller in my apps.

I had create this in my config/routes.php:

$route['(:any)'] = "user/$1";

but it's override all the route in my apps to "User" Controller.

Is there any simple route for Codeigniter that doesn't override the other controller routes?

© Stack Overflow or respective owner

Related posts about codeigniter

Related posts about routes