[Zope] SiteAccess will kill me ;-)

Chris Withers chrisw@nipltd.com
Tue, 25 Apr 2000 23:37:57 +0100


Right, I have a server, zope.nipltd.com
and on that server lives a site, in a folder, BayC.
Now, through the magic of Apache:
www.bay-c.co.uk --> zope.nipltd.com/BayC

Anyway, I have an access rule:

<dtml-if "REQUEST.has_key('HTTP_HOST')">
 <dtml-in virtual_hosts>
  <dtml-if "_.string.lower(REQUEST['HTTP_HOST'])==_.string.lower(_['sequence-item'])">
   <dtml-call "REQUEST.setURL(path='/')">
  </dtml-if>
 </dtml-in>
</dtml-if>

and I have a property of the BayC folder, virtual_hosts, set to www.bay-c.co.uk.


I have a DTML method, debug, in the BayC folder, of my zope server's root:
<HTML>
<BODY>
<a href="&dtml.url-index_html;">index_html</a><BR>
<a href="<dtml-var index_html url>">index_html</a><BR>
<a href="<dtml-var "this().absolute_url()">">index_html</a><BR>
</BODY>
</HTML>

now, the above rule should mean that when I go to:
http://www.bay-c.co.uk/debug

I get urls:
http://www.bay-c.co.uk/index_html
http://www.bay-c.co.uk/index_html
http://www.bay-c.co.uk/

or not?

however, what I actually get is:
http://www.bay-c.co.uk/BayC/index_html
http://www.bay-c.co.uk/BayC/index_html
http://www.bay-c.co.uk/BayC

Grrrr....

To make matters worse/better, the following code (from Squishdot 0.3.2) works exactly the way (I
think;) it should with the above access rule:
        req=self.REQUEST     
        par=req['PARENTS']     
        url=req['URL1']    
        mylist = par[:-1]     
        mystr = ''     
        for p in mylist:     
            if p.meta_type == 'Squishdot Site':    
                p = rfind(url,mystr)    
                if p >= 0:    
                    urlstr = url[:p]    
                else:    
                    raise "Squishdot site_url could not compute site_url"    
                return urlstr    
            else:    
                mystr = '/' +  str(p.id) +  mystr     
    
        raise " Squishdot site_url:could not find site"    
        return ""

So the /BayC/'s get stripped out of URLS where <dtml-var site_url> is used.
However, in Squishdot 0.3.4, which I would like to use, all the above code is replaced with:
       return self.absolute_url()

Which does not work with the above access rule. 

More Grrrrr.....
I am loosing hair and sleep :(

Please help me before I am bald.

Chris

PS:
Zope 2.1.4
SiteAccess 1.0.1