From 9b58f57b0cd9893a44c9d4381de4c82626242e94 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Sun, 3 May 2015 13:46:02 +0200 Subject: added handling for 404 cases (catch all) --- src/master.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/master.cpp') diff --git a/src/master.cpp b/src/master.cpp index 0699051..086ebe3 100644 --- a/src/master.cpp +++ b/src/master.cpp @@ -2,6 +2,7 @@ #include "strusCms.hpp" #include +#include namespace apps { @@ -25,4 +26,17 @@ void master::ini( content::master &c ) c._root = cms.root( ); } +void master::register_common_pages( ) +{ + cms.dispatcher( ).assign( ".*", &master::not_found_404, this ); +} + +void master::not_found_404( ) +{ + content::master c; + ini( c ); + c.url = cms.request( ).script_name( ) + "/" + cms.request( ).path_info( ); + render( "not_found_404", c ); +} + } -- cgit v1.2.3-54-g00ecf