Imitating SiteRoot in an accessrule
Hi All, 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? With regards, Ivo -- Drs. I.R. van der Wijk -=- Brouwersgracht 132 Amaze Internet Services V.O.F. 1013 HA Amsterdam, NL -=- Tel: +31-20-4688336 Linux/Web/Zope/SQL/MMBase Fax: +31-20-4688337 Network Solutions Web: http://www.amaze.nl/ Consultancy Email: ivo@amaze.nl -=-
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/ ---------------------------------------------
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.. Cheers, Ivo -- Drs. I.R. van der Wijk -=- Brouwersgracht 132 Amaze Internet Services V.O.F. 1013 HA Amsterdam, NL -=- Tel: +31-20-4688336 Linux/Web/Zope/SQL/MMBase Fax: +31-20-4688337 Network Solutions Web: http://www.amaze.nl/ Consultancy Email: ivo@amaze.nl -=-
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/ ---------------------------------------------
participants (2)
-
Ivo van der Wijk -
Martijn Pieters