Chat with us, powered by LiveChat
Types of URL ( Absolute and Relative )

Types of URL ( Absolute and Relative )

Absolute URL :

Dictionary meaning of word absolute is : not dependent on any thing ie independent having its own existence, same is the meaning of absolute urls.
An Absolute URL is, thus, something that is independent or free from any relationship from the rest. When you use an absolute URL, you point directly to the file you give exact location of the file.

eg : “sitename.com/images/welcome.gif” is an absolute url as it specifies that an image file welcome.gif located in the images directory, under yoursitename domain.
You should always opt for absolute url when referring to other site.Generally such url are long and hence are not much preferred by lazy webdeveloper they like to use relative urls. While changing directory structure you need to rewrite whole path of the new directory and file which can be cumbersome but as far as SEO is concerned spiders like to crawl absolute url.

Relative URLs :

A relative URL points to a file/directory in relation to the present file/directory.
They have short urls as they are referring to root directory/subdirectory.Relative urls helps webmaster to maintain the site without rewriting the whole path again and again if they had made any changes in directory.

eg : ../image/welcome.gif is a relative url (The initial two peroids (..) in the url instruct the server to move up one directory (which is the root directory), then enter images directory and finally point at welcome.gif file )
Relative urls are to used wisely otherwise an error may occur and the intended file may not open.Relative URLs are short and does not require to write whole path so due to its short typein nature they are more popular and are commonly used by webmasters.

Grab a Website Today

Sharing

Leave your comment

Pin It on Pinterest

Share This