also tag 'patch/core', considering that over half of the changes are there
[ikiwiki] / doc / todo / apache_404_ErrorDocument_handler.mdwn
1 Apache's ErrorDocument directive lets you write a CGI script that will be invoked for all 404s.
2 IkiWiki could offer one as an optional wrapper; it would do much the same thing that the
3 existing recentchanges_link (or [[generic___39__do__61__goto__39___for_CGI]]) does when
4 encountering a nonexistent page.
5
6 I think it'd probably have to be a separate CGI script because the environment with which
7 404 handlers are invoked is somewhat odd, and because it needs to return a 404 status
8 (having said that, it might make sense for `recentchanges_link` to return 404 rather than
9 200 anyway if the page doesn't exist).
10
11 > This turns out to be untrue, as long as the wrapper lets a couple of extra
12 > environment variables through. --[[smcv]]
13
14 This would give IkiWiki the behaviour of many other wikis, where visiting a page that
15 does not yet exist prompts you to create it, without having to invoke the CGI for
16 successful requests.
17
18 Due to [a well-known MSIE misfeature](http://support.microsoft.com/default.aspx?scid=kb;en-us;Q294807),
19 error output needs to be at least 512 bytes long, so some padding might also be required.
20
21 Implemented in the 'goto' branch in my git repository. You can see this
22 feature in action [on my blog](http://smcv.pseudorandom.co.uk/no/such/page/).
23 --[[smcv]]
24
25 [[done]]