Yes, I know this has been discussed here before, but the archives have rolled over and the thread is gone :-( Why does the url grow ( something like a/b/a/b/a/b/a//b/a/b )? and what can be done to prevent it?
Why does the url grow ( something like a/b/a/b/a/b/a//b/a/b )? and what can be done to prevent it?
This is the danger of using relative references within Zope. If you use absolute_urls to reference an object, then the URL will be the shortest path to the object and avoid the endless looping path. <a href="&dtml.url-myobject;"> <a tal:attributes="href here/myobject/absolute_url"> Cheers, Trevor
On Tue, May 13, 2003 at 08:44:33PM +0200, Maik Jablonski wrote:
Dennis Allison wrote:
Why does the url grow ( something like a/b/a/b/a/b/a//b/a/b )? and what can be done to prevent it?
That's Zopes aquisition... Use absolute_url to prevent infinte urls.
IIRC, I used to see growing URLs in the ZMI when doing managing through a virtual host using a SiteRoot. I'm on an apache/VirtualHostMonster setup now and it doesn't do that.. -- Paul Winkler home: http://www.slinkp.com "Muppet Labs, where the future is made - today!"
Dennis Allison wrote at 2003-5-13 11:33 -0700:
Yes, I know this has been discussed here before, but the archives have rolled over and the thread is gone :-(
Why does the url grow ( something like a/b/a/b/a/b/a//b/a/b )? and what can be done to prevent it?
Avoid non-trivial relative URL references. A trivial URL reference is one not containing a "/". They are harmless. A relative URL reference containing a "/" is non-trivial unless the path segment before each "/" is either "." or "..". Non-trivial URL references can cause growing URLs. Do not use them. Dieter
On Wed, May 14, 2003 at 08:55:05PM +0200, Dieter Maurer wrote:
Avoid non-trivial relative URL references.
A trivial URL reference is one not containing a "/". They are harmless.
I'm afraid it's not that simple. You can see this with the following experiment: 1. Create a folder, "A". Check the "create public interface" option. 2. Go inside A. Create a folder, "B". Check the "create public interface" option. 3. Edit A/index_html. Add this line at the bottom of the body: <a href="B"> make the URL grow! </a> 4. Edit A/B/index_html. Add this line at the bottom of the body: <a href="A"> make the URL grow! </a> We now have created two pages which contain what you call a "trivial URL reference". 5. Go to folder A and click the "View" tab - to best show what follows, open it in a new browser window or tab. 6. now click the link repeatedly. five clicks later, I'm at http://my-zope-site:8080/A/B/A/B/A/B This can be prevented by replacing the link URLs with absolute URLs. For flexibility, that's best done by getting the object and calling its absolute_url method. In CMF sites, i've found that relative links from one bit of content to another are not a problem in practice, but relative links in the framework (skins) are a big problem and should be avoided. -- Paul Winkler home: http://www.slinkp.com "Muppet Labs, where the future is made - today!"
participants (5)
-
Dennis Allison -
Dieter Maurer -
Maik Jablonski -
Paul Winkler -
Trevor Toenjes