[Zope-CMF] Virtual Hosting with CMF...

Richard Shebora rlist@apogee-tech.com
Thu, 19 Jul 2001 13:33:19 -0400


Hi all,

I just started using Zope two months ago and love it.  I have done a lot of
reading to figure out how to do virtual hosting, and want to host a dozen or
so sites from one instance of Zope.  So far it works great.  It does not
behave as expected on the WebDav and FTP though.  There are several ways to
do Virtual hosting... could you guys shed some light on the one that works
consistently across all protocols that Zope serves up?

Currently using a standard rewriter and clever path management within each
site's folder.  No siteroot or virtual hosting monsters yet.  I can get the
two latter methods to work, but only for one domain.  I know I am missing
something and/or just don't see the snake.

Not looking for anyone to do all the work for me, unless there's a
convenient snippet available.  I hope that someone can suggest the best
approach and offer some links to the resources that I can read for that
approach.  I am still very new to this, but am committed to making it work.

Thanks,
Richard

The following is the rewriter code:
===============================

<dtml-unless "REQUEST.path and REQUEST.path[0][:6]=='manage'">

<dtml-in "[('www.apogaion.com', 'www.apogaion.com'),]">
<dtml-if "HTTP_HOST[-_.len(_['sequence-key']):]==_['sequence-key']">
<dtml-call "REQUEST.path.append(_['sequence-item'])">
<dtml-return " 'ignored' ">
</dtml-if>
</dtml-in>

<dtml-in "[('www.shebora.com', 'www.shebora.com'),]">
<dtml-if "HTTP_HOST[-_.len(_['sequence-key']):]==_['sequence-key']">
<dtml-call "REQUEST.path.append(_['sequence-item'])">
<dtml-return " 'ignored' ">
</dtml-if>
</dtml-in>

<dtml-call "REQUEST['TraversalRequestNameStack'].append('hosted')">

</dtml-unless>