I'm using the following code in my routes.php to hide the controller name from the URL structure:
$route['(:any)'] = "auth/$1";
It works great, but my problem is this: When I want to access another controller, it seems to treat it as a function of the hidden controller.
So for example. I have
http://mysite.com/controller1/somefunction
which turns into:
http://mysite.com/somefunction
What if I want to access:
http://mysite.com/jsonfunction/anotherfunction/
How can I access the other controller while keeping the other one hidden? I really don't want visitors seeing http://mysite.com/maincontroller/ that's just redundant!
You are going to have to define your routes more specific I am afraid. You can still use:
But it will probably go to the button of your list of routes.
if you want other routes to be added that overrule that one you'll have to place them on top. For example like this:
See this document for more info and future reference: http://codeigniter.com/user_guide/general/routing.html