Versión en español




URI and URL definitions


The World Wide Web can be conceived as a large group of resources or contents placed in different computers all around the world. These contents can be found and can link each other through URIs. As its name describes, identifies resources assigning them addresses in a given network.

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:

Protocol
Also called URL scheme, this specifies which protocol is used to access the document.
Computer name
Gives the name of the computer (usually a domain name or IP address) where the content is hosted.
Directories
Secuence of directories separated by slashes that define the path to follow to reach the document.
File
The name of the file where the resource is located.

This way we can analyze any given URL:

http :// www.htmlquick.com / reference / uris.html
Protocol Domain name Directories File

Some URLs may not contain any directory, and some other parts of it can be omitted depending on the situation. For example, when the file is not defined in an HTTP request, web servers automatically send default files (e.g., index.htm). 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://).

Examples of URLs:

ftp://someserver.com/some-res.php (no directories defined)
http://www.w3.org/TR/CSS21/ (no file specified)
http://www.htmlquick.com/reference/tags/a.html


Relative URIs

Relative URIs are partial URIs used to refer to a document from another one in the same computer. This way we can define a relative URI as the path to follow from the actual document's location (directory path) to the destination resource's location, plus its file name.

Supose that the actual 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 actual document will be: "new/best/two.asp"

The special directory ".." provides a way 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.



Bypass footer options  |   Send to a friend Send to a friend  |  Post to del.icio.us Post to del.icio.us

Digg this page Digg this!  |  File on Furl File on Furl  |  Add to Yahoo! MyWeb Add to Yahoo! MyWeb

Bypass W3C declarations | 

Valid XHTML 1.0 Strict  |  Valid CSS Why should you trust us? Click the images on the left to see how seriously we write our own pages, then make your choice.

Level Triple-A conformance icon, W3C-WAI Web Content Accessibility Guidelines 1.0. This website gives its best effort to achieve the Level Triple-A Conformance, W3C-WAI Web Content Accessibility Guidelines 1.0. If you find any detail or error that we didn't see, don't hesitate and let us know.

The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect. -- Tim Berners-Lee, W3C Director and inventor of the World Wide Web.

 Link to us  |  Contact us  |  Beyond HTML  |  Tools and resources  |  Sitemap  |  Webmaster