[Zope] Re: Virtual links...

Josef Meile jmeile@hotmail.com
Tue, 14 May 2002 16:42:50 +0200


After a lot of reading and testing different solutions, finally I found one
that parcially works for my case. The only problem is that it works on
Internet Explorer, Opera, and Netscape 4.x, but not on Netscape 6.x
and K-Meleon (a Mozilla based web browser).

Here is what I did:

My website structure is the following:
http://www.myzope.mycompany.mycountry:8080/folder1/folder2/mysitefolder
I know is a complicated structure but I can't change it.

And I would like to change it for:
http://www.mypage.mycompany.mycountry:8080
Later I'll move it to my main site and it would be
http://www.mypage.mycompany.mycountry
But as I've seen the port where your zope is running
doesn't care. The important thing is that your virtual
links point to the server where Zope is installed and
in my case that works.

Access rule:

In the first line I changed [-2:] for [-3:] because my
domain has 3 parts and not 2 as the normal ones.
<dtml-let
hostname="_.string.join(_.string.split(_.string.lower(_.string.split(HTTP_HO
ST, ':')[0]), '.')[-3:], '.')"
               sitemap="{'mypage.mycompany.mycountry': 'mysitefolder'}">
  <dtml-if expr="sitemap.has_key(hostname)">
    <dtml-call "REQUEST.set('SiteRootPATH', '/')">

    Here I pushed the three folders that compound my
    site into the "TraversalRequestNameStack".
    As I read on one site, I have to "push the further
    most object/deepest object in the ZODB onto the
    stack first" and then the others.
    Deepest folder: <dtml-call
"REQUEST['TraversalRequestNameStack'].append(sitemap[hostname])">
    Second folder: <dtml-call
"REQUEST['TraversalRequestNameStack'].append('folder2')">
    First folder: <dtml-call
"REQUEST['TraversalRequestNameStack'].append('folder1')">
  </dtml-if>
</dtml-let>

Add a SiteRoot in "mysitefolder" with Base and Path
empthy (as it is docs page).

Then I checked the STUPID_LOG_FILE and there
wasn't any error message there.

In the Z2.log appears:
xxx.xxx.xxx.xx - Anonymous [16/May/2002:16:19:17 +0200] "GET / HTTP/1.1" 200
213
7 "" "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.2)
Gecko/20010726 N
etscape6/6.1"

I guess it means that Netscape 6.x could process the
page, but I just saw a blank page.

Does anybody know what is the problem?