Hi, I've just noticed an annoying difference in the handling of directories in zope. If I create an directory /myDirectory, put an index_html file there, and a my.css file the index_html should use in the same directory refering to it with <link rel=stylesheet type=text/css href="my.css"> in the head of my document I get a structure that would work perfectly fine in apache, but not in zope. /myDirectory /myDirectory/index_html /myDirectory/my.css Accessing http://example.com/myDirectory in zope would give me the files http://example.com/myDirectory/index_html and http://example.com/my.css In apache the server would return a location header like: Location: http://example.com/myDirectory/ and then my browser would know it should ask for http://example.com/myDirectory/my.css Zope doesn't seem to set the location header, so asking for http://example.com/myDirectory/ http://example.com/myDirectory returns different results if the index_html contains relative URLs below /myDirectory/. Bug or feature? -jf
On Mon, May 28, 2001 at 09:01:20AM +0200, Jan-Frode Myklebust wrote: | In apache the server would return a location header like: | | Location: http://example.com/myDirectory/ | | and then my browser would know it should ask for | http://example.com/myDirectory/my.css | | Zope doesn't seem to set the location header, so asking for | | http://example.com/myDirectory/ | http://example.com/myDirectory | | returns different results if the index_html contains relative URLs | below /myDirectory/. | | Bug or feature? Feature. If you look closely, you'll see that Apache actually issues an HTTP redirect to the resource with the trailing slash. It knows when to do this as it can look on the filesystem to see if you are referring to a directory or a file, and fix up your request accordingly. Zope, being a hierarchy of objects supporting inheritance et al, cannot make the same decisions in a consistantly reliable manner. Zac
On Mon, May 28, 2001 at 05:09:17PM +1000, Zac Stevens wrote:
| | returns different results if the index_html contains relative URLs | below /myDirectory/. | | Bug or feature?
Feature.
So why change it in Zope 2.4?:) This change had me totally confused for a while.. It seems that in 2.4 the publisher will put a <base href> in the header when one accesses a folder object, unless it's already there. I just ran one of my pages trough the validator.w3.org, and it complained that <base href="something" /> ^^^ wasn't valid. I search trough all my files for where it could be putting in this extra '/', and eventually grep'ed trough the zope-source for it to find it in the publisher. Very confusing.. This should be documented in the 2.4 migration guide. BTW: why end the base href with '/>', and not simply '>'? -jf
On Wed, Jul 18, 2001 at 11:28:23AM +0200, Jan-Frode Myklebust wrote: <SNIP>
BTW: why end the base href with '/>', and not simply '>'?
<base> is an empty tag meaning it's only got attributes and no character content. In XML (and I guess HTML 4 too) empty tags are ended with / (like <base .... />) instead of using <base...></base>. In XML the end tags are mandatory. This is for XML and I don't know if the same thing is true for HTML 4, but I guess it is. Funny that the w3c validator doesn't like it. -- Martin Skøtt martin@xenux.dk Xenux Aps - The Linux People
Jan-Frode Myklebust writes:
So why change it in Zope 2.4?:) This change had me totally confused for a while.. It seems that in 2.4 the publisher will put a <base href> in the header when one accesses a folder object, unless it's already there. This is there for ages.
The new thing is the closing ' />' rather than '>'. It was introduced to be compatible with XHTML, in case your other content tries to be XHTML compatible. Dieter
Hi Jan-Frode, comparing Apache with Zope is like comparing apples with oranges ;) Although some objects in Zope are called "Folder" and some "Documents" or even "Files" these are all objects. if you use the URL /a/b/c you traverse a path to object c as subobject of b which is in turn subobject of a. If an object is called, its method index_html (by convention) is normally invoked. This method can (like all others) be acquired down the path, meaning, if you have one index_html as method of the root Folder object, you have it virtually on any sub-folder object unless you create a new one there which is like "overloading" a method. (see documentation on OOP) Anyway, /a/b/c is equal to /a/b/c/ in Zope. Unlike apache it does not have to redirect (which can be turned of on apache too) Just link to /a/b/c/ if it bothers you. You might want to use <link rel=stylesheet type=text/css href="<dtml-var my.css url>"> To always get the right URL. Regards Tino --On Montag, 28. Mai 2001 09:01 +0200 Jan-Frode Myklebust <janfrode@parallab.uib.no> wrote:
Hi,
I've just noticed an annoying difference in the handling of directories in zope. If I create an directory /myDirectory, put an index_html file there, and a my.css file the index_html should use in the same directory refering to it with <link rel=stylesheet type=text/css href="my.css"> in the head of my document I get a structure that would work perfectly fine in apache, but not in zope.
/myDirectory /myDirectory/index_html /myDirectory/my.css
Accessing http://example.com/myDirectory in zope would give me the files http://example.com/myDirectory/index_html and http://example.com/my.css
In apache the server would return a location header like:
Location: http://example.com/myDirectory/
and then my browser would know it should ask for http://example.com/myDirectory/my.css
Zope doesn't seem to set the location header, so asking for
http://example.com/myDirectory/ http://example.com/myDirectory
returns different results if the index_html contains relative URLs below /myDirectory/.
Bug or feature?
-jf
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
participants (5)
-
Dieter Maurer -
Jan-Frode Myklebust -
Martin Sk?tt -
Tino Wildenhain -
Zac Stevens