CGI: set up goto hook so that /ikiwiki.cgi?do=goto can be an Apache ErrorDocument

master
Simon McVittie 2009-01-31 18:09:24 +00:00
parent 8322b8c9c8
commit 170b86a2ef
1 changed files with 8 additions and 1 deletions

View File

@ -403,7 +403,14 @@ sub cgi (;$$) {
# commenter are for compatibility with any saved URLs # commenter are for compatibility with any saved URLs
if ($do eq 'goto' || $do eq 'recentchanges_link' || if ($do eq 'goto' || $do eq 'recentchanges_link' ||
$do eq 'commenter') { $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. # Need to lock the wiki before getting a session.