Welcome Guest, Not a member yet? Register   Sign In
Unexpected routing behaviour
#1

[eluser]GreGre[/eluser]
I am posting this because I could not find if such question was already answered or even asked.

Here's my problem
I have a route directive

Code:
$route["desk/(:any)"] = "$1";

I am expecting the following behaviour:
the url desk/controller/method should be the same as controller/method

But instead, I get a 404.

Any ideas why?
#2

[eluser]CroNiX[/eluser]
Try capturing the controller and method separately:
Code:
$route["desk/(.*)/(.*)"] = "$1/$2";  //covers desk/controller/method
$route["desk/(.*)"] = "$1";          //covers desk/controller, will route to controller/index
#3

[eluser]GreGre[/eluser]
Thanks for the answer. It didnt work though.

The funy part is, this works as expected:
Code:
$route["p/(:any)"] = "page/display/$1";
regardless of the number of arguments submitted after p/

Maybe any idea on how to debug this? The 404 error is not much of a help. I'd like to now what (non existing) controller is actually called. I would then be able to debug it myself.




Theme © iAndrew 2016 - Forum software by © MyBB