/** * Presents browser with a custom 404 page. */ function behavior_page_not_found($url) { $page = Page::findByBehaviour('page_not_found'); if (is_a($page, 'Page')) { header("HTTP/1.0 404 Not Found"); header("Status: 404 Not Found"); $page->_executeLayout(); exit; // need to exit otherwise true error page will be sent } }