[Zope] Imitating SiteRoot in an accessrule

Martijn Pieters mj@zope.com
Tue, 15 Jan 2002 10:49:32 -0500


On Tue, Jan 15, 2002 at 04:35:54PM +0100, Ivo van der Wijk wrote:
> Is it possible to imitate the behaviour of a SiteRoot object in an
> access_rule? 
> 
> The basic idea is like this: Alot of virtual hosts point to our Zope server,
> and an access_rule in the / of the Zope server dispatches request to the
> appropriate subfolder.
> 
> This works perfectly, except that base href in generated documents is wrong,
> it includes the entire path, while I would like it to skip the part up to
> the actual root of the site.
> 
> This can be solved by installing a default SiteRoot in the subfolders, but
> I would rather not depend on all these SiteRoots (which people will modify,
> delete, etc, also the make managing these folders difficult)
> 
> Is it possible to adjust the SiteRoot/SiteBASE/?? directly in my accessrule?

I have built virtual domains with only an access_rule and a
VirtualHostMonster. Isa simple. I just manipulate the taversal stack based
on the HTTP_HOST var and voila, instant virtual hosts. You can make this
pretty generic and not need a SiteRoot object at all.

-- 
Martijn Pieters
| Software Engineer  mailto:mj@zope.com
| Zope Corporation   http://www.zope.com/
| Creators of Zope   http://www.zope.org/
---------------------------------------------