What is the difference between Absolute and Relative paths / urls ?
A Relative URL is a the path to a file relative to the current location. If the file is in the same location as you are in you can just write it’s file name – extension included.
[html] file.jpg [/html]
An alternate is writing a single dot and location delimiter before the file name.
[html] ./file.jpg [/html]
If it’s in a folder
[html] folder/file.jpg [/html]
Of if it’s in a parent directory
[html] ../file.jpg [/html]
Relative URLs are ok for static htmls. If you move the whole directory directory structure will be preserved and you won’t have to change links. Note that they can be tricky when using a CMS as you cannot be sure of the current location – and even if you are the CMS can always change that.
An Absolute URL is a full path to the file. It can be accessed from anywhere on the web, from any site as it provides the full address. An example is:
[html] http://digitalzoomstudio.net/folder/file.jpg [/html]
The first part is the protocal. For web addresses this is usually http or https – the later being a secure version of http – http://en.wikipedia.org/wiki/HTTP_Secure.
The second part is the address ( digitalzoomstudio.net/folder/ ) to the directory of the file.
The last part is the file name ( extension included ).
If you are using a CMS like WordPress you should always this type of url as you can easily manage links and access from any location of the CMS.
If you are moving a directory from one location to another and the directory contains htmls with absolute link – note that links should be replaced too.