URL is abbreviation for Uniform Resource Locator. It is a formatted text string that are used by Web browsers, email clients and some software to identify a network resource over the Internet. Network resources are files like plain Web pages, text documents, graphics, programs, etc.
In simple words, URL is the location of a file on the web. When one types the address of a web page in the browser’s address bar, he is typing a URL. The most common format of a URL is illustrated by the image below:
The URL string consist of three parts/sub-strings:
- Network Protocol
- Host Name or Address
- File or Resource Location
These sub-strings are separated by special characters as show below:
protocol :// host / location
The ‘protocol‘ is a network protocol used to access a resource. These strings are short names usually followed by ‘://‘. URL protocols may include http://, ftp://, and mailto://.
The ‘host‘ identifies a computer or a network device. Hosts come from standard Internet databases such as DNS and can be names or IP addresses. For example, consoleindiainc.com is the host for this Web page.
The ‘location‘ contains a path to a specific network resource on the host. Resources are normally located in a host directory or folder. For example, /directory-name/filename.html.
When the location element is omitted the URL usually points to the root directory of the host and is often the home page (like ‘index.html, default.aspx, etc.’).
Absolute vs. Relative URLs
Full URLs featuring all the three sub-strings are called absolute URLs. But in some cases URLs contain only one location element. These are relative URLs. Relative URLs are used for efficiency by Web servers and few other programs when they already
know the correct URL protocol and host.