URL (Uniform Resource Locator):
Suggested Reading:
Types of URL:
URLs vary depending on the location of the document to which user will link. Basically, URLs fall into two categories; Absolute and relative URL. They are described below.
(i) Absolute URL:
An absolute URL contains all the information necessary to find the files on the internet. It contains the protocol indicator, hostname, folder name and file name. Absolute URL are similar to address used by the U.S. Postal Service, which include a name, street address, apartment number, city, state and zip code. If some of the information is missing ― say, the street number or house number ― the carrier can’t deliver the mail to the right person.
Similarly, if the protocol indicator or hostname is missing from a URL, browsers can not link to a specific file because they wont know where and how to look for the file. Likewise, if the folder or file name is missing, browsers won’t know which piece of information to pull of the server. The given is an example of absolute URLs
(ii) Relative URLs :
A relative URL usually contains only the folder name and file name or even just the file name. We can use these partial URLs when we are pointing to a file that’s located within the same folder or on the same server as the originating file. In these cases, a browser doesn’t need the server name or the protocol indicator because it assumes the files are located in a folder or on a server that’s relative to the originating document.