From 170b86a2efb1908355f5812eaa3f3de4a2dcaa49 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Sat, 31 Jan 2009 18:09:24 +0000 Subject: CGI: set up goto hook so that /ikiwiki.cgi?do=goto can be an Apache ErrorDocument --- IkiWiki/CGI.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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. -- cgit v1.2.3