diff --git a/public_html/rewrite.php b/public_html/rewrite.php
index cc8c589..66f2ed9 100644
--- a/public_html/rewrite.php
+++ b/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 */
diff --git a/public_html/templates/error/404.tpl b/public_html/templates/error/404.tpl
new file mode 100644
index 0000000..da6f430
--- /dev/null
+++ b/public_html/templates/error/404.tpl
@@ -0,0 +1,4 @@
+
+ 404 Page not found
+ The requested page could not be found.
+