How does correct URL look like?


[ In English... ] [ Po
 Polsku... ]

Correct URL for document send through HTTP protocol (most of WWW documents) has the following form: http://host.name/path.

First part should be obvious, but let's discuss the end part. Given path can be a path to a file (eg. http://www.coven.vmh.net/tech/urls.html.en) and then it's also obvious how it should look, or a path to a directory - and here the problems arise.

Directory path should end with a slash (/) (eg. http://www.coven.vmh.net/tech/, and also eg. http://www.coven.vmh.net/), which differentiates it from file path. Unfortunately many people forget this, and don't put it there (many commercials do so!).

Of course that, erroneus URL also works, but... Let's think what will happen when we use the correct URL, and when we use the URL without the ending slash.

In the first situation client (browser) sends (correct) URL to the server, and it sends the document back. That's how it should look like.

In the second situation - client sends erroneus URL to the server. Server states such document does not exist, but guesses the ending slash was missing, and sends back to client a redirection request with the URL with added slash. Then client sends the request once more - with a corrected URL, and server sends document back.)

Why is it bad? From the client's side it means longer wait time before document arrives, and, if he pays for his connections - higher payments (bigger traffic!).

From the server's owner side - payments as above, and also excessive growth of server's logs (two requests instead of one).

And also - it generates bigger net traffic - which hurts us all, because it unreasonably jams the net.)

So - for our and others' interest - watch out what we're typing in in browser's goto field, and when advertising our pages - type their correct URL...


Paweł Więcek <coven@vmh.net>
All rights reserved.
This page's URL: http://www.coven.vmh.net/tech/urls.html