Browse Source

Return a 404 error when a page does not exist

develop
Sven Slootweg 9 years ago
parent
commit
3ac9274b1f
  1. 10
      public_html/rewrite.php
  2. 4
      public_html/templates/error/404.tpl

10
public_html/rewrite.php

@ -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 */

4
public_html/templates/error/404.tpl

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