[Zope] Re: Apache/VHM _and_ AccessRule at the same time

Evan Simpson evan@4-am.com
Mon, 16 Jun 2003 12:07:59 -0500


Danny W. Adair wrote:
> I'm running into some problems having Apache Rewrite -> Virtual Host 
> Monster and an Access Rule _at the same time_.

Unfortunately, VHM and your Access Rule are fighting over the virtual 
root, and VHM is losing.  Setting the virtual root was never really a 
good way to handle this sort of thing anyway, and I plan to add a set of 
methods in Zope 2.7 that will do it properly.  For now, I recommend 
patching your ZPublisher/HTTPRequest.py to add the following method just 
above setVirtualRoot():

     def appendToPath(self, path):
         """ Append path elements used to construct URLs. """
         self._steps.extend(map(quote, path))
         self._resetURLS()

...and changing your Rule to:

stack = request['TraversalRequestNameStack']
customer_id = stack.pop()
request.set('customer_id', customer_id)
request.appendToPath([customer_id])

Cheers,

Evan @ 4-am