To achieve this, put something like this in the wiki's Apache configuration
file:
- ErrorDocument 404 /cgi-bin/ikiwiki.cgi
+ ErrorDocument 404 /ikiwiki.cgi
+
+(The path here needs to be whatever the path is to the ikiwiki.cgi from
+the root of your web server.)
+
+Or put something like this in the wiki's Lighttpd (>=1.4.17) configuration file:
+
+ server.error-handler-404 = "/ikiwiki.cgi"
+
+