Re: URL specification: referring to the current directory.

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 UTC