I would like to know the differences between these two types of URLs: relative URLs (for pictures, CSS files, JS files, etc.) and absolute URLs.
In addition, which o
Let's say you have a site www.yourserver.com. In the root directory for web documents you have an images sub-directoy and in that you have myimage.jpg.
An absolute URL defines the exact location of the document, for example:
http://www.yourserver.com/images/myimage.jpg
A relative URL defines the location relative to the current directory, for example, given you are in the root web directory your image is in:
images/myimage.jpg
(relative to that root directory)
You should always use relative URLS where possible. If you move the site to www.anotherserver.com you would have to update all the absolute URLs that were pointing at www.yourserver.com, relative ones will just keep working as is.