The World Wide Web can be conceived as a large group of resources placed in different computers all around the world. These resources can be found and linked through URIs. As its name describes, it identifies resources by assigning them addresses in a given network.
A URL is a type of URI that's used to describe the location of a specific document. A URL doesn't define the type of content to be found (texts, images, movies, etc.); it only says where and how to find it. A common URL is composed by four parts:
This way we can analyze and split any given URL. For example, let's take a look at the URL of the HTML span element (http://www.htmlquick.com/reference/tags/span.html):
Some URLs may not contain any directory, and other parts of it can be omitted depending on the case. For example, when the file is not defined in an HTTP request, web servers automatically send default files (e.g., index.html). Also, when typing a URL in some browsers, if the protocol is absent (e.g., www.servername.com/index.php), the empty space is automatically replaced by the HTTP protocol prefix (http://).
Below, are some examples of URLs:
Relative URIs are partial URIs used to make a reference to a document from another one in the same computer. In other words, we can define a relative URI as the path to follow from the current document's location (directory path) to the destination resource.
To understand it better, supose the current document, located at "http://webserver.es/documents/index.asp", needs to point to a document located at "http://webserver.es/documents/new/best/two.asp". The relative URI to refer to that resource from the current document will be: "new/best/two.asp". If you take a closer look at the previous example, you can construct the destination URL (with an algorithm) only using the current document's URL and the relative URI.
The special directory ".." allows to go back to the parent directory. So, to point from "http://newwebserver.mil/documents/new/best/res.htm" to "http://newwebserver.mil/documents/old/best/june.htm", the relative URI will be: "../../old/best/june.htm".
For more information about interlinking resources, please refer to our "Organizing a website" tutorial.
Diseño y desarrollo: Latitud29.com