In my cake application, I have a referral program for salespersons. For each signup the user can pass a referral id. Normally, my website has a default route which does the following:
//www.mydomain.com -> www.mydomain.com/pages/home
Router::connect('/', array('controller' => 'pages', 'action' => 'display', 'home'));
Now I want to route to another controller/action like this:
//www.mydomain.com/r:1234 -> www.mydomain.com/users/signup/r:1234
Router::connectNamed(array('r'));
Router::connect('/*', array('controller' => 'users', 'action' => 'signup'));
Router::connect('/', array('controller' => 'pages', 'action' => 'display', 'home'));
The routing for the signup works fine now, but the default route doesn't work anymore. I think the order is ok. Any ideas?
AppController::beforeFilter(). - Martin Bean