URL (Uniform Resource Locator):
URL (Uniform Resource Locator) is often defined as a string of characters that is directed to an address. It is a very commonly used way to locate resources on the web. It provides a way to retrieve the presentation of the physical location by describing its network location or primary access mechanism.
The protocol is described within the URL which is employed to retrieve the resource and resource name. The URL contains http/https at the start if the resource may be a web type resource. Similarly, it begins with ftp if the resource may be a file and mailto if the resource is an email address. The syntax of an URL is shown below where the primary part is employed for protocol and the remainder of the part is employed for the resource which consists of a website name or program name.
Here, the domain name describes the server (web service) and program name (path to the directory and file on the server).
URI (Uniform Resource Identifier):
Similar to URL, URI (Uniform Resource Identifier) is also a string of characters that identifies a resource on the web either by using location, name or both. It allows uniform identification of the resources. A URI is additionally grouped as a locator, a name or both which suggests it can describe a URL, URN or both. The term identifier within the URI refers to the prominence of the resources, despite the technique used.
The former category in URI is URL, during which a protocol is employed to specify the accessing method of the resource and resource name is additionally laid out in the URL. A URL may be a non-persistent sort of the URI. A URN is required to exist globally unique and features a global scope.
Difference between URL and URI:
|URL is used to describe the identity of an item.||URI provides a technique for defining the identity of an item.|
|URL links a web page, a component of a web page or a program on a web page with the help of accessing methods like protocols.||URI is used to distinguish one resource from other regardless of the method used.|
|URL provides the details about what type of protocol is to be used.||URI doesn’t contains the protocol specification.|
|URL is a type of URI.||URI is the superset of URL.|
Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.
- URL Shorteners and its API in Python | Set-1
- Pros and Cons of URL Shorteners
- URL Shorteners and its API in Python | Set-2
- Finding IP address of a URL in Java
- Typosquatting/URL Hijacking
- Node | URL.hash API
- Node | URL.host API
- What happens when we type a URL
- Difference between Stop and Wait, GoBackN and Selective Repeat
- Difference and similarities between HashSet, LinkedHashSet and TreeSet in Java
- Difference between Stop and Wait protocol and Sliding Window protocol
- Similarities and Difference between Java and C++
- Difference between Yaacomo and and XAP
- Difference between VoIP and and POTS
- Difference and Similarities between PHP and C
- Difference between Time Tracking and Time and Attendance Software
- Difference Between Single and Double Quotes in Shell Script and Linux
- Difference between ++*p, *p++ and *++p
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.