In this tutorial you are going to learn about URL Uniform Resource Locator, explanation, content of a URL, syntax and it's examples.
What is URL ?
URL stands for Uniform Resource Locator. Complete address of a website is called URL or web address. Each webpage has a designated unique address called the URL or the Uniform Resource Locator. URL is the type of Uniform Resource Identifier (URI).
Contents of a URL
URL is made up of the following parts:
- Protocol
- Just after protocol ( :// ) colon followed by double forward slash is used
- Hostname (Domain Name) or IP Address
- Sub-Domain Name
- Path of file
Syntax of a URL
protocol:// hostname (domain name)/ filename
Protocol - It is a standardized set of rules which allows communication of electronic devices with each other. Most webpage URL begins with http:// which stands for Hyper Text Transfer Protocol, used to transfer pages on the web. Some websites have https (Hypertext Transfer Protocol Secure) which means that the webpage has a special layer of encryption added to hide your personal information and passwords.
Hostname (Domain Name) - It is basically the domain name of the server which is used on the network. It is the unique reference that identifies a website.
Domain Names | Description |
.com | Commercial organizational, Businesses and companies |
.org | Non-profit organizations |
.gov | Government Institutions |
.edu | Educational Institutions |
.mil | Military organizations |
.net | Network providers |
Sub Domain Name - A subdivision of the domain name ,which is usually a country code abbreviation.
au | in | it | jp | cn | kr |
Australia | India | Italy | Japan | Chine | Korea |
Examples of sub domain name or the country code abbreviations
Filename - It is used for describing the pathname of the file which is located on the server.
Working of a URL
Client click on URL/Hyperlink to send it as a request to the server. In return the server send the page or file which the user want to access.
Example of a URL
https://www.thecode11.com/about
This URL contains the information of protocol: https, hostname: thecode11.com and filename: about.
Difference Between URL and URI
The terms URL and URI are often used interchangeably, but they are not same.
- A URI is an identifier of a specific resource. Like a page, book or a document.
- A URL is special type of URI that also tells you how to access it, such as HTTPs, FTP, etc.
- If the protocol is either present or implied for a domain, you should call it a URL, even though it's also a URI.
This post is written by Ritika Nagar (BCA, Sharda University). If you like TheCode11, then do follow us on Facebook, Twitter and Instagram.