//We redirect from in ajax calls, so we need to detect those redirects function redirect($url, $status = null) { if ($this->RequestHandler->isAjax()) { $url = '/ajax/'.ltrim($url, '/'); } parent::redirect($url, $status); }