[Zope] Imitating SiteRoot in an accessrule

Martijn Pieters mj@zope.com
Tue, 15 Jan 2002 11:07:22 -0500


On Tue, Jan 15, 2002 at 04:59:57PM +0100, Ivo van der Wijk wrote:
> On Tue, Jan 15, 2002 at 10:49:32AM -0500, Martijn Pieters wrote:
> > 
> > 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.
> > 
> 
> I've just done this - the only tricky part was to avoid recursion
> (it seems that the access_rule is invoked before and after the vhm? 
> Anyway, my connection hung)
> 
> Is this still efficient? It's alot of rewriting/manipulation for each request
> that comes in..

There are two optimizations you can make:

- Make the access rule an external method

- look at what the VHM does, then implement this in your external method so
  you don't need the VHM anymore. The VHM is nothing but a special access
  rule.

Or you could loose the acess rule and have Apache do the rwriting plus one
VHM to interpret the rewritten URLs.

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