Ask a Question
Advertise on boostr.in
Organizational Research By
Surprising Reserch Topic
Experts Most Trusted Topic
how to create codeigniter route that doesnt override the other controller route
how to create codeigniter route that doesnt override the other controller route Â using -'codeigniter,routes'
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";
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?
I've got simple regex for this problem, from: Daniel Errante's Blog
$route['^(?!ezstore|ezsell|login).*'] = â€œhome/$0â€³;
where ezstore, ezsell, and login are the name of controller in Your Apps.
Â Â Â Â
Sep 15, 2015
to add a comment.
Related Hot Questions
Government Jobs Opening