diff options
author | Andreas Baumann <mail@andreasbaumann.cc> | 2015-05-03 13:46:02 +0200 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2015-05-03 13:46:02 +0200 |
commit | 9b58f57b0cd9893a44c9d4381de4c82626242e94 (patch) | |
tree | 125034cf70cd371bb52b4db53f082def7830717b /src/master.cpp | |
parent | 399cea0f02b46d2253e5d8aa2a67e8f30271c23b (diff) | |
download | aCms-9b58f57b0cd9893a44c9d4381de4c82626242e94.tar.gz aCms-9b58f57b0cd9893a44c9d4381de4c82626242e94.tar.bz2 |
added handling for 404 cases (catch all)
Diffstat (limited to 'src/master.cpp')
-rw-r--r-- | src/master.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
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 <cppcms/service.h> +#include <cppcms/url_dispatcher.h> 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 ); +} + } |