diff --git a/conf/dokuwiki.php b/conf/dokuwiki.php index 65383017c5c06ea71eff1ee9cee447f3de2d1612..1b4a44a382485b7d05ae471a4f7bf3cc6be8baa4 100644 --- a/conf/dokuwiki.php +++ b/conf/dokuwiki.php @@ -80,6 +80,7 @@ $conf['subscribers'] = 0; //enable change notice subscription sup $conf['pluginmanager'] = 0; //enable automated plugin management (requires plugin) $conf['compress'] = 1; //Strip whitespaces and comments from Styles and JavaScript? 1|0 $conf['hidepages'] = ''; //Regexp for pages to be skipped from RSS, Search and Recent Changes +$conf['send404'] = 0; //Send a HTTP 404 status for non existing pages? $conf['rss_type'] = 'rss1'; //type of RSS feed to provide, by default: // 'rss' - RSS 0.91 // 'rss1' - RSS 1.0 diff --git a/doku.php b/doku.php index 7913354f7edd7ca4dbf3951c5aded67a342aed6a..d6da8b1d087bb7a1a49608b262092a5580bb9a78 100644 --- a/doku.php +++ b/doku.php @@ -53,6 +53,11 @@ //make infos about the selected page available $INFO = pageinfo(); + //send 404 for missing pages if configured + if($conf['send404'] && !$INFO['exists']){ + header('HTTP/1.0 404 Not Found'); + } + //prepare breadcrumbs (initialize a static var) breadcrumbs();