I\'ve got a cakephp app that I\'m trying to get to serve up the Pages::404 function (and corresponding view) whenever Cake encounters any error (missing control
Are you in the controller when you are trying to redirect to the 404 error page?
Well if that is the case, you can walk around the problem like this:
Copy and paste the error layout (error404.ctp) from the cake core library directory into yours app/views/errors/
Then add the following line whenever you encounter an error inside a controller.
$this->cakeError('error404',array(array('url'=>'/')));
Oh, another way to handle this is to edit the routes.php file in app/config
CakePHP Official site Routes-Configuration
I don't have a working copy of CakePHP at the moment, so I would just describe the basic logic here(what you can do inside the routes.php file)
Redirect traffic with specific url patterns(say, http://yourwebsite/validController/validFunction/validParam) to their corresponding destinations respectively. Redirect all other traffic (missing controller, model, view, etc) to 404 page.
Hope that helps:)