summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <smcv@ http://smcv.pseudorandom.co.uk/>2009-01-31 18:09:24 +0000
committerSimon McVittie <smcv@ http://smcv.pseudorandom.co.uk/>2009-01-31 18:09:24 +0000
commit170b86a2efb1908355f5812eaa3f3de4a2dcaa49 (patch)
tree11405db5ac2b59d4885421b89d456716520b2f65
parent8322b8c9c82941c4052bcc8a0d1824a92d6426a0 (diff)
CGI: set up goto hook so that /ikiwiki.cgi?do=goto can be an Apache ErrorDocument
-rw-r--r--IkiWiki/CGI.pm9
1 files changed, 8 insertions, 1 deletions
diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm
index 82cad40c8..7e968d966 100644
--- a/IkiWiki/CGI.pm
+++ b/IkiWiki/CGI.pm
@@ -403,7 +403,14 @@ sub cgi (;$$) {
# commenter are for compatibility with any saved URLs
if ($do eq 'goto' || $do eq 'recentchanges_link' ||
$do eq 'commenter') {
- cgi_goto($q);
+ my $page = undef;
+
+ if ($ENV{REDIRECT_STATUS} eq '404') {
+ $page = cgi_page_from_404($ENV{REDIRECT_URL},
+ $config{url}, $config{usedirs});
+ }
+
+ cgi_goto($q, $page);
}
# Need to lock the wiki before getting a session.