diff options
-rw-r--r-- | IkiWiki/CGI.pm | 9 |
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. |