On Tue, 15 Jan 2002, Mithun Bhattacharya wrote:

> > IIRC, that's not true. All browsers (the ones I have
> > checked - lynx,
> > konqueror) canonicalise the user entered URL to
> > proto://host.domain/
> > before using it.
> 
> Hehe probably to help those crazy webservers who dont know that they
> should be doing it if the client hasnt. Even then I think it does
> explain why that trailing slash is needed ....


According to the RFC, if no path is specified, the useragent MUST 
specify / as the path.

Therefore, if I type http://gcc.gnu.org, the browser MUST do this:

GET / HTTP/1.1
Host: gcc.gnu.org:80

But, if I type http://gcc.gnu.org/mydir, the browser MUST do this:

GET /mydir HTTP/1.1
Host: gcc.gnu.org:80

even if it knows that /mydir is a directory and not a plain file.

If /mydir is a directory, then the server SHOULD respond with

301 Moved permanently
Location: http://gcc.gnu.org/mydir/
Uri: http://gcc.gnu.org/mydir/

some content saying the page has moved



On receiving which, the browser would either:

display the content, which is most likely a link to the actual url, but 
could be anything

or:

make a new request:

GET /mydir/ HTTP/1.1
Host: gcc.gnu.org:80


The bandwith savings that you mentioned do occur if you typed the 
trailing slash for a directory, but not if it is for the root directory.

One last point.  If you look at the way IE handles urls, it will always 
remove the trailing slash that you type in when saving a url in history.

When IIS receives a request for a directory, but without the trailing 
slash, and if there is no ambiguity (which is generally the case), then 
it sends the directory.

Thus, IE's behaviour works well with IIS, but makes IE seem slow with 
other servers.

Philip

-- 
The generation of random numbers is too important to be left to chance.



_______________________________________________
linux-india-help mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/linux-india-help

Reply via email to