簡単そうで簡単でない、それがCakePHP…
- AppController.phpにやらせる場合
public function appError($error) { if (isset($error) && get_class($error) == 'MissingControllerException') { $this->redirect('/'); } }
- ルーティングにやらせる場合
Router::connect('/**', ['controller' => 'xxx', 'action' => 'index']);