[Zope] Re: Multiple domains from one server process?

Evan Simpson evan@tokenexchange.com
Mon, 28 Jun 1999 11:18:50 -0500


>> I'll hunt for the ZPublisher patch and try it, because it sounds as a
>> good place to help this problem.
>
> I'm not sure that ZPublisher is the right place to solve this. If I
> understand correctly, you are looking for a way to chop some fixed
> string '/path/path' off the front of the PATH_INFO for every request. I
> would guess that doing this in ZServer rather than in ZPublisher might
> be a better idea.

As the author of a ZPublisher patch for this problem (possibly the one
referenced above), allow me to lay out the problem.  Sadly, my patch turns
out to be only a partial fix; I'm thinking hard about how to improve it.

The problem occurs when a URL such as "http://host.com/C/D" refers to object
"A/B/C/D" in the Zope object hierarchy, usually by rewriting in Apache.  The
"internal" URL constructed by Zope as it traverses the objects necessarily
includes "A" and "B", as they are part of the access path.  Whenever an
"external" URL is produced for client consumption, via URLn in a var tag for
example, it should *not* include "A" and "B".

My patch simply discards the "internal" URL once object traversal is
complete, and replaces it with the contents of SCRIPT_URL.  This takes care
of URLn and BASEn, but not usage of SCRIPT_NAME+PATH_INFO.  Also, passing
through a __bobo_traverse__ gives the target object an improper URL.

The desired behavior is to simply omit from the constructed URL the first n
objects traversed, which ought to be ordinary Folders.  I'm considering
simply passing the number n to ZPublisher in an environment variable so that
it can leave the URL alone until the number is decremented to zero.

The only problem I see with this is that there's no valid "external" URL for
the first n objects traversed, so access error messages relating to these
objects will be munged.  I also don't see any way around that.

then-again-I-also-didn't-see-the-other-problem-until-too-late-ly y'rs
Evan Simpson