Myths, legends and mysteries of the absolute paths and urls

During the last few years, Internet City has been under a constant threat, totally unbalanced between the forces of good and evil… Okay, this would be a great start a novel or story of science (not fiction), but today we’re going to talk about other things (the legends, myths, and other herbs will remain for some possible future or past edition).

Anyway, today in ¨Myths, legends, mysteries, and other herbs¨…. we will only be talking about the differences between absolute paths and absolute URLs.

The term ‘absolute path’ refers to the main folder or document with the domain’s name.

An absolute URL is one that starts with the protocol of transference and refers to a document on our site.


Let’s suppose that in the root directory we create a document index.html, this document is the absolute path: http://www.lastwebdesigner.com/.

To clarify a little, the true absolute path for each domain in all of the Internet is always, always ”/” (and try to debate and convince me otherwise, but I doubt it will work).

Some people tend to confuse what a relative path is with an absolute path, and even more so if they mix up the cables and confuse ”URL” (links) with ”Path” (folders), which is to say, an ”absolute path” is not the same as an ”absolute URL.

The absolute URLs always start with the protocol of transference (http,htpps,etc.), followed by the name of the domain (or IP), plus the document we are searching for (whether this is an image, an html document, or whichever other document).

The Absolute Paths always start with the root of the domain where they can be found (without protocols, without ports) and point directly to the document that we select, for example, an image that is saved in the folder ”img” that was previously created in the race of the site and whose name (that of the image, of course), is ”image.jpg”. Alright, now we have an archive with the name ”index.html” that we’ve created in another folder ”htmls” also from the race from the Website. The norm is that when we open the image with some editor WYSIWYG (I’m not going to name a specific product… since they don’t pay me for advertising), in our code, we notice that what we have written our unbelievable, never well-pondered and often one of the reasons for poorly-treated editors… leaving us with something like:

<img src=”../img/image.jpg” alt=”image” />

What does the superior code tell us? Well, that we have inscribed a new image with its relative path, that which, if we never move the HTML archive of a site or do not use anything to rewrite our pages, will always be available and will be perfectly visible. But, what happens if we move the page and we create it in another subfolder, for example: ”/htmls/subfolder/index.html’‘?

In this case, we can say “bye” to our supply of milk (but don’t worry, because new cows are born each day and will surely produce more), knowing we will not see the precious image, even if we see a beautiful “image not found” error (depending on the navigator this can appear in various forms). Although with security we will always see the alternative text (image tagged with ”alt”) Firefox furthermore needs you to create the tag ”title” that will function equal to the tag ”alt” (one can see that they have forgotten about this and I don’t see that they’ve done anything to fix it), but that is another issue and our topic today is links and absolute paths.

To conclude (thanks to this hot and cold time), remember the differences between an absolute Web ”URL” address an absolute Path.

The absolute URLS are always those that begin with the protocol of transference and refer to some document from our site.

The absolute paths make reference only and exclusively to our Website and it is recommended to eliminate the ”disappearance” of links or images on our site (with the great advantage that if we move our server site, or apply rewrite technology, we won’t have to touch our code at all).

Juan Carlos Barreiro. I develop web sites and software from 1996 using diferents technologies (delphi, java, php, classic asp, vbscript & .net), today focusing on Classic ASP and .NET technologies. My web site :Enterprisedreams.net

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

If you liked this post , consider to subscribe to the Rss.

3 Responses to “Myths, legends and mysteries of the absolute paths and urls”

  1. Jenna says:

    Pretty cool post. I just found your blog and wanted to say
    that I’ve really liked reading your posts. Anyway
    I’ll be subscribing to your blog and I hope you write again soon!

  2. KonstantinMiller says:

    You know so many interesting infomation. You might be very wise. I like such people. Don’t top writing.

  3. Generally I do not post on blogs, but I would like to say that this post really forced me to do so! really nice post.

Leave a Reply

Security Code: