I am using a PagesController (not the same that Cake has built in) and I would like to connect a new route:
Router::connect('/*', array('controller' => 'pages', 'action' => 'view'));
I really want Cake to ONLY use this route if all other (default) routes fail. However, I can't seem to get it to work with just routes. I have a hunch that I will need to use a custom CakeRoute class, but I have absolutely no idea how to get it to do what I want it to do.
Could somebody please help me with this?
[edit] Oh and it might be useful to know that I'm using CakePHP 2.2.0
[2nd edit] On request, a little more info. My router currently looks like this:
Router::connect('/', array('controller' => 'pages', 'action' => 'index'));
CakePlugin::routes();
require CAKE . 'Config' . DS . 'routes.php';
Router::connect('/*', array('controller' => 'pages', 'action' => 'view'));
And when I go to /home/about I get "Error: HomeController could not be found." I also tried this:
Router::connect('/', array('controller' => 'pages', 'action' => 'index'));
CakePlugin::routes();
Router::connect('/*', array('controller' => 'pages', 'action' => 'view'));
require CAKE . 'Config' . DS . 'routes.php';
But then EVERYTHING is routed to my pages controller and I don't want that. I only want that route to be used if all other routes fail.
Again, I have a hunch that this can only be done with a custom CakeRoute class, but I have no idea how exactly.