Return a 404 error when a page does not exist

develop
Sven Slootweg 11 years ago
parent a597290a01
commit 3ac9274b1f

@ -60,7 +60,15 @@ foreach($routes as $category => $items)
/* Route the actual request */
$router->RouteRequest();
try
{
$router->RouteRequest();
}
catch (RouterException $e)
{
http_status_code(404);
$sPageContents = NewTemplater::Render("error/404", $locale->strings, array());
}
/* Render the resulting page */

@ -0,0 +1,4 @@
<section>
<h2>404 Page not found</h2>
The requested page could not be found.
</section>
Loading…
Cancel
Save