This used to be on ZwikiProblems, but I had to move it as it got a bit silly with all my updates. --GTK

Request: does anyone know of a way to stop Zope from issuing 404 messages and display a particular object instead?

I should explain why I asked. I have lots of pages on my ZWiki which just do this:

<dtml-call "RESPONSE.redirect(_['URL1'] + /SeeThisOneInstead)">

that I want to graft on proper ZWiki aliasing support. The problem is that to do this we really need some support from either the folder itself, or from something else that might be in a position to intercept.

Transparent Folders (see below) can intercept, but only in basic ObjectManagers that don't override __getattr__, which cuts out using BTreeFolder or derivatives.

I'm still checking SiteAccess2.

Failing all these, I'll need to write a ZWikiFolder class to deal with all this rubbish. It shouldn't be that hard to make smart enough that it either supports aliases or not depending on its context.

Here's the silliness that prompted me having to shift this all to this page. It's handy if only for a historical take on how I got to this point:

if you have apache in front of it using proxypass, apache's error-redirect option might work ?

I'm thinking of trying TransparentFolders to map /WikiName to /interface/wikifolder/WikiName, but it still doesn't solve the 404 handling. Perhaps what I need is a special ZWikiFolder? --GTK
Bugger. Transparent folders contain objects which are acquired by their parents. All well and good, but I can't use it to have the same bunch of Wiki pages acquired by two different folders, each with a different user interface.

That said, the mechanism implemented for TransparentFolders is fantastic, and I suspect it could easily be adapted for our uses. --GTK

Wrong! The way it subverts OFS.ObjectManager is fantastic, but the patched __getattr__ is over-ridden by (say) BTreeFolder's __getattr__. Damn damn damn. Nice for normal Folders or anything which doesn't frob with __getattr__, though. --GTK

I'm also eyeing off SiteAccess2, which provides for a specific method in a folder to be called before anything is provided AND can adjust site roots (is this affected like RonDagostino observed with SiteServer??), and also BTreeFolder, which might well cope with the discussion objects I'm planning to unleash with my ZWiki. --GTK
Just downloaded both, and will be testing. --GTK

Anyone mind if I just sit here talking to myself? Thanks. --GTK

well it looks like you have this discussion well in hand :) this issue is a little beyond me right now but interesting - keep us posted --SM

20001027: funny - come back a month later and it all makes sense. I believe a SiteAccessRule? will do what you (and I) want here. It just needs to redirect to the editform method. --SM

Or you could just use the standard_error_message to detect non-existing URLs?. See for an example. --MartijnPieters