Re: handling URLs for multiple sites in single bluebream instance

Thierry Florac <[email protected]>
Newsgroups gmane.comp.web.zope.bluebream,gmane.comp.web.zope.devel
Organization Office National des Forêts
Message-ID <20110617143102.143406f9@m60053>
Le Fri, 17 Jun 2011 16:47:59 +0530,
Joshua Immanuel <[email protected]> a écrit :

> In order to serve the same application to multiple clients,
> I've added a container named say 'Site' to the root and made them as
> sites by site.setSiteManager(LocalSiteManager(site)).  So, the root
> may contain many of those 'Site' containers say 'site1', 'site2',
> etc. and the application specific objects/containers resides under
> them.
> 
> The application specific URL say "/container1/object1/@@add.html"
> would now become "/site1/container1/object1/@@add.html" for 'site1'
> and "/site2/container1/object1/@@add.html" for 'site2' etc. depending
> on which client (site) is being served. So, how should the URLs be in
> the templates? Or in other words, how to handle URLs for multiple
> clients (sites) for the same application.
> 
> If anyone can explain or point me to some documentation related to
> this, it would be very helpful.


Hi,

I guess you just want to do virtual hosting inside a single BlueBream
application server...
The simplest way to handle such a configuration is to "hide" the BB
server behind (for example) an Apache HTTP server with rewrite rules.

For example :

<VirtualHost w.x.y.z:80>
    ServerName    www.site1.org
    RewriteEngine on
    RewriteRule   /(.*)    http://localhost:8080/site1/++vh++http:%{SERVER_NAME}:80/++/$1 [P,L]
</VirtualHost>

and idem for site2.

Given this configuration, any call to absoluteUrl(object,request) will
retrieve a good URL matching the given site.

With hope this helps...

Regards,
Thierry
-- 
  Chef de projets internet/intranet
  Office National des Forêts
  Département Informatique
  2, Avenue de Saint Mandé
  75570 PARIS Cedex 12

  Tél. : 01 40 19 59 64
  Fax. : 01 40 19 59 85
  Mél. : [email protected]
  WWW  : http://www.onf.fr
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.