[Zope3-Users] Re: Adding another "special" traversal component type

Philipp von Weitershausen philipp at weitershausen.de
Wed Sep 20 11:03:34 EDT 2006

FB wrote:
> Hi,
> I'd like to make URLs like
>  http://servername/~username
> possible on my Zope3 server which should instantly redirect a
> visitor to one of my site user's home pages.

Like Jonathan suggests, this smells like you want an Apache rewrite rule.

> Is this possible? Of course, the answer ist yes (by patching
> zope.traversing.adapters.traversePathElement) - but is there
> a more Zope3ish way to do that?

zope.traversing has little to do with actual traversal. The naming is 
unfortunate. I should've been more careful when I moved that package.

zope.traversing and its machinery are about resolving paths, e.g. like 
they occur in TALES path expressions.

IPublishTraverse adapters are used when donig URL traversal (the "real" 
kind of traversal). You could customzie the IPublishTraverse adapter for 
ISite to detect ~username path elements. The default IPublishTraverse 
adapter for containers is in zope.app.container.traversing.


More information about the Zope3-users mailing list