Virtual Hosting

Revision: $Id$


This document explains how to deal with inside-out virtual hosting when building URLs to objects, including breadcrumbs URLs.

Related tickets:

These tickets are fixed by using proper methods (portal_url methods) to get proper paths (relative or not) to objects.

Still, some issues need to be fixed:

1   General Case of Virtual Hosting

The most complex case or need of virtual hosting is the case where part of the portal is hidden in the URL, and part of the URL is completely virtual:

This can be achieved with a rewrite rule like:

RewriteRule ^/foo/bar(.*)$ http://localhost:20000/VirtualHostBase/http/%{SERVER_NAME}:80/cps/workspaces/VirtualHostRoot/_vh_foo/_vh_bar/$1 [L,P]

2   Fundamental concepts

The fundamental concepts manipulated inside CPS are:

The rpath is the Zope path relative to the portal. It's called "relativeContentURL" by CMF, but this is wrong as it's not a URL.

An object's URL is only used on output; it's not used for internal treatments.

3   Public methods

The only public methods to be used by user code are:

4   Internals

OFS.Traversable methods:

CMF URLTool methods:

CPS URLTool adds new methods: