W3C home > Mailing lists > Public > www-talk@w3.org > September to October 1997

Re: URL specification: referring to the current directory.

From: Arnoud <galactus@htmlhelp.com>
Date: Sat, 13 Sep 1997 20:09:19 +0200
To: www-talk@w3.org
Message-ID: <PbtG04uYOJfW089yn@htmlhelp.com>
In article <Pine.SOL.3.93.970912161301.24836H-100000@lamin>,
Brian Kelly <lisbk@ukoln.ac.uk> wrote:
> How should one refer to an internal anchor in such a file.  Are
> 
> <A HREF="./#section1>An internal anchor in the default file</A>
> <A HREF="index.html#section1>An internal anchor in the default file</A>
> 
> equivalent, 

These are not equivalent, just as the URLs without the #section1
fragment identifier are not equivalent. In most cases, they will
refer to the same document at the same location, because most servers
will send back the contents of file 'index.html' if the browser requests
a 'directory URL'. But that is only a convention.

(I'm assuming you intended to close the quotes for the values of both
HREF attributes)

> or with browsers or other user agents treat #section1 as a 
> filename?

They must not. The #section1 part must always be treated as a
fragment identifier. If you want to use a literal '#' character
in an URL, you must URL-encode it as %23 (the hexadecimal code
for the position of the '#' character in the ISO Latin 1 character set).

-- 
E-mail: galactus@htmlhelp.com .................... PGP Key: 512/63B0E665
Maintainer of WDG's HTML reference: <http://www.htmlhelp.com/reference/>
Received on Saturday, 13 September 1997 14:13:11 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 27 October 2010 18:14:23 GMT