[Zope3-dev] ++vh++ and relative URLs

Garrett Smith garrett at mojave-corp.com
Wed Feb 23 11:39:39 EST 2005


Marius Gedminas wrote:
> On Wed, Feb 23, 2005 at 01:13:14AM -0600, Garrett Smith wrote:
>> I've got Apache sitting in front of a zope 3 server (using rewrite
>> rules and ++vh++ namespace) -- any relative URLs in a page don't
>> make it through to the browser. If I specify an absolute URL, the
>> URLs can be read.
> 
> If you use relative URLs, they should continue to work, as long as you
> do not climb outside your virtual hosting root.  Could you be more
> specific as to the problem you have?
> 
> ++vh++ tells Zope 3 how to generate URLs when you use @@absolute_url
> and things like <img tal:attributes="src context/++resource++pic.png"
> />. 

Ah, gotach. I was just using using a relative URL directly in a 'src'
attribute.

> ++vh++ does not tell Zope 3 to scan your page templates for href
> attributes on <a> elements and change them in some way.
> 
> If you use things like <a href="/foo.html"> or <img src="/@@/pic.png"
> />, that's exactly what you will get in the output, and it might or
> might not work with virtual hosting, depending on your rewrite rules.

Okay, this is helpful. Thanks!

 -- Garrett


More information about the Zope3-dev mailing list