Re: URL specification: referring to the current directory.

In article <Pine.LNX.3.95.970910120425.13950I-100000@andrew.triumf.ca>,
Andrew Daviel <andrew@andrew.triumf.ca> wrote:
> I thought this was wrong, but of course it's right ...  Typically one asks
> for "/foo/bar" then gets a redirect to "/foo/bar/".  Then (Apache, anyway)
> one gets sent the content of the DirectoryIndex, such as
> "/foo/bar/index.html". In this case the browser location box displays
> "/foo/bar/".

And it should. The 301 redirection after the first request tells the
browser that the URL you chose should be updated too. And the fact
that the server sent back the contents of some file when you asked
for a "directory" URL is irrelevant - the server could just as well
have generated a directory overview and send that.

> I would think that a spider may see "/foo/bar/" 
> and "/foo/bar/index.html" as distinct URLs, unless some scheme to
> eliminate duplicates is implemented (maybe the big guys do..)

Well, they *are* distinct URLs, although they have the same content.
A smart spider may use SHA or MD5 to check for duplicates, and give
both URLs as alternatives.

> The server root on Apache is special; "http://foo.org", "http://foo.org/"
> amnd (typically) "http://foo.org/index.html" all get the same content
> without redirection.

That's because in this case, there is no trailing slash and no
ambiguity. If you ask for "http://foo.org" the *browser* knows
that you meant "http://foo.org/" and can then ask for "/" on
that server. 

In the "http://foo.org/bar" case, the browser cannot know if you
meant "/bar" or "/bar/", so it cannot add a slash to avoid the
redirection.

-- 
E-mail: galactus@htmlhelp.com .................... PGP Key: 512/63B0E665
Maintainer of WDG's HTML reference: <http://www.htmlhelp.com/reference/>

Received on Thursday, 11 September 1997 13:07:45 UTC