Skip to navigation
Real World Computing

Parlez-vous Internet?

Posted on 2 Jul 2002 at 17:35

If you can't speak the Net lingo, don't worry, as Davey Winder has all the answers - in good old plain English.

There are two different types of URI/URL at present: absolute and relative (some might say three if you include fragment identifiers, but as they've never been an official part of the http scheme I won't cover them here). An absolute URL, as the name suggests, provides the complete Internet address needed to locate a specific resource. It does this by first specifying the transfer protocol scheme, then the host server name and finally the directory and file itself, as explained above.

Relative URLs can access files without supplying the whole address. You'll most probably have used far more relative URLs in your Web browsing travels than you have absolute ones, even though you might not realise it. For the vast majority of Web sites, most links point to resources (documents and files) located on the same server, often in the same directory: these are called relative because their address is relative to the URL of the base HTML document in which they're embedded. When you access a relative URL this base section is automatically linked to the client, saving the need for any separate specification. In other words, whenever you move from one page to another on the same site, the browser can ignore everything that appears after the last backslash in the URL and replace it with the relative URL specified, thus creating in essence a new absolute reference. Relative URLs, obviously, can only be used when the linked resource is located at the same base URL as the original calling document, but they're essential if you want to make a site portable, as well as for the most economical HTML expression.

Finally, I guess I should say a word or two about abbreviating URLs, especially seeing as I'm as guilty of this practice as anyone. As you'll by now, I hope, appreciate, the syntax for URIs and URLs has been developed so as to remove ambiguous references to network resources, at the expense of being less than easy on the eye. Not that long ago URLs were a constant source of jokes for the mainstream the media, because of all the colons and backslashes they required. Nowadays, however, when the newsreader has finished his story, he'll probably say simply 'more about this on our Web site at www.bbc.co.uk' or whatever, in the process totally removing the URL's scheme. This same shorthand has now become accepted in print, and whenever I refer to a Web page I won't bother with the additional typing of http://, because it's annoying, time-consuming and can look scruffy on the page. The only time I would include the URL scheme would be if it's some resource other than a Web page I'm referring to, like an ftp site or a Telnet resource.

The danger comes, though, when people start using such abbreviated URIs on the Net and discover that their fancy clients (the latest versions of Netscape Navigator and Internet Explorer, for example) can understand them too. Over time this may lead them to believe, wrongly, that this shorthand URL is the accepted norm, and that's when things could fall apart. When some new URI schemes are introduced, the client won't be able to translate them correctly, nor will the server be able to deliver the resources requested. Think about it: if a shorthand URL has exactly the same syntax as a relative URL path it just won't work, effectively limiting its use to sites without defined base URLs. So perhaps the time has come to take what appears to be a backward step into the future and start using those full URIs from now on.

Wavey's Web site of the month

1 2 3 4 5 6
Be the first to comment this article

You need to Login or Register to comment.

(optional)

advertisement

Latest Real World Computing
Latest Blog Posts Subscribe to our RSS Feeds
Latest News Stories Subscribe to our RSS Feeds
Latest Reviews Subscribe to our RSS Feeds

advertisement

Sponsored Links
 
SEARCH
SIGN UP

Your email:

Your password:

remember me

advertisement


Hitwise Top 10 Website 2008
 
 

PCPro-Computing in the Real World Printed from www.pcpro.co.uk

Register to receive our regular email newsletter at http://www.pcpro.co.uk/registration.

The newsletter contains links to our latest PC news, product reviews, features and how-to guides, plus special offers and competitions.