From: Simon McVittie Date: Sat, 31 Jan 2009 18:09:24 +0000 (+0000) Subject: CGI: set up goto hook so that /ikiwiki.cgi?do=goto can be an Apache ErrorDocument X-Git-Tag: 3.04~86^2~4 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=170b86a2efb1908355f5812eaa3f3de4a2dcaa49;p=ikiwiki.git CGI: set up goto hook so that /ikiwiki.cgi?do=goto can be an Apache ErrorDocument --- 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.