Trailing slash in URLs

Edward Spodick, HKUST Library, 2358-6743 lbspodic at uxmail.ust.hk
Fri Sep 13 22:14:27 EDT 1996


At 1:07 PM 13/9/96, Thomas Dowling wrote:
>3. An incoming request, with NO trailing slash, for a directory name, gets
>an HTTP redirection code pointing at the same URL WITH a trailing slash.
>All browsers I'm aware of then automatically execute a second connection to
>get the URL with the trailing slash.

This is not correct for all servers.  For example, MacHTTP (the earlier
freeware version of WebStar - I do not know whether WebStar does the same
thing) operates as follows:

http://sqzm14.ust.hk      - this will give the default file
                            for http://sqzm14.ust.hk/


http://sqzm14.ust.hk/distance/  - this will give the default file for that
                                  directory (in this case my paper on
                                  distance learning :)



http://sqzm14.ust.hk/distance   - this will give an error message of file not
                                  found.  I can include text in this error
                                  message telling the user that they should
                                  try putting a slash after the URL if it does
                                  not end in .html, .htm, or .txt

The reason given for this behaviour is server security.  If there is no
default file, most servers provide a directory index - this is what is
considered a security breach.  I would prefer the server to look for a
default file, and if it did not find one, then give an error of some
configurable kind, but I am pretty happy with this freeware product.

--- end forwarded text


- - - - -
Edward F Spodick, Systems Librarian - lbspodic at usthk.ust.hk or @uxmail.ust.hk
Hong Kong University of Science & Technology Library
tel:  852-2358-6743    fax:  852-2358-1043




More information about the Web4lib mailing list