[Zope] grokking _vh_ in VirtualHostMonster
Evan Simpson
evan@4-am.com
Thu, 16 Aug 2001 10:28:48 -0400
From: "seb bacon" <seb@jamkit.com>
> RewriteRule ^/([^/]+)/?(.*)
http://localhost:9080/VirtualHostBase/http/www.foo.com:80/demo/$1/SomeFo
lder/VirtualHostRoot/$1/$2 [P]
>
> RewriteRule ^/([^/]+)/?(.*)
http://localhost:9080/VirtualHostBase/http/www.foo.com:80/demo/$1/SomeFo
lder/VirtualHostRoot/_vh_$1/$2 [P]
>
> Why did the second version (with _vh_) work, but the first not?
Because 'VirtualHostRoot' removes all of the path up to that point from
the URL, and does this by remembering the absolute_url() of the object
found at that step. In your first version, putting '$1' in the path a
second time complicated acquisition a little, but does nothing for your
URL. I added the '_vh_' behavior to support people who map a domain
subdirectory into a Zope's root. Yours is an intermediate case, mapping
a domain subdirectory into a Zope subfolder. Path segments like
'_vh_XXX', right after the 'VirtualHostRoot', add to the URL path
without trying to find a Zope object named 'XXX'.
Cheers,
Evan @ 4-am & Zope