What is the difference between relative and absolute url?

Showing Answers 1 - 6 of 6 Answers

vani.rao.s

  • Apr 12th, 2006
 

An Absolute URL is independent or free from any relationship. When you use an absolute URL, you point directly to the file. Hence, an absolute URL determines the exact location of a file/directory on the internet. It also follows that each absolute URL is unique, which means that if two are identical, they point to the same file.

For example:
http://www.geekinterview.com/images/example.gif

A relative URL points to a file/directory in relation to the present file/directory.

Example:
 ../images/example.gif

  Was this answer useful?  Yes

guna

  • Apr 27th, 2006
 

absolute url is of the form "http://localhost:8080/jsp-examples/jsp/index.jsp" as vani rao says its a direct and straight way of identifyig a servlet or jsp or a html or a applet which is available in a container...then relative url is once after reaching the container we can identify pages or etc... using relative url its of the form "/jsp-examples/jsp/index.jsp"

  Was this answer useful?  Yes

Karan

  • Sep 27th, 2011
 

As there seems to still be confusion about the difference between relative and absolute urls, I thought I'd post a little information and a reference link for everyone.

An url that is ABSOLUTE shows the complete address. In other words, there is no confusion about where this item is located, as the ABSOLUTE URL gives the entire path to that file.
http://www.youtube.com/watch?v=8LD0i-Dp_-Y is an example of an ABSOLUTE URL.


A url that is RELATIVE only shows a partial address - like "images/me.jpg" - and the success or failure of finding the file is contingent on certain conditions being met - which means the outcome can and will vary, depending largely how how the directories within your website are structured.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions