Table of Contents
A URL is a Uniform Resource Locator. It is a string of characters used to refer to a document or file on the Internet. The general format of a URL is https://example.com/path/to/file. A URI, on the other hand, stands for Uniform Resource Identifier. It’s just another term for URL, but it refers specifically to addresses and paths used in web documents rather than any other file type.
What is a URL?
A URL is a unique address for a resource on the Internet. It consists of three parts:
- The protocol identifier tells you how to reach it (e.g., HTTP://)
- The domain name (e.g., google.com)
- A path (e.g., /maps/)
It is the address of a resource on the web. It comprises three parts: protocol, hostname, and path. It means you need its URL address to find a website. The URL address is usually in the form of http://example.com/path/to/page. The protocol specifies how the data is sent between client and server. HTTP(s), FTP, and file.
Hostname defines server location (domain name).
The route indicates the web page. Protocol identifiers explain how to access resources. In HTTP, the protocol identification is HTTP://. The domain name identifies your server.
The path identifies where on the server your resource is located. For example, the path /maps/ points to a subfolder of Google’s website that contains maps-related resources (e.g., images).
URLs find PDFs and Word files. To download your favourite magazine’s newest issue, visit their website and select “Download PDF.” It loads a new page with a “Download PDF” button.
What is URI?
It stands for Uniform Resource Identifier, which is how we identify resources on the Internet. URIs are used in HTTP requests, so they may have different formats Depending on their use. For example, a URI could be in the form of an address bar URL For a web page, or it could be in the form of an email address. A string of characters identifies a resource, such as a web page, email message, or file.
The URI is usually made up of three parts:
- A scheme (such as “HTTP”)
- A hostname (such as “www.example.com“)
- An optional port number (such as 8080).
The scheme identifies the protocol for accessing the resource; the hostname is the server’s name on which the resource resides, and the port number is used to determine which server on that host should be contacted to retrieve the resource. A URI does not represent the location of the resource itself—it only tells you where to find it.
For example, if you had a web page at http://www.example.com/weather, that page would have a URI: http://www.example.com/weather/. But even if you knew the URI of that page, you wouldn’t be able to access it unless you also learned how to access the server where it lives (which is probably on port 80).
Difference between URL and URI
URLs are Uniform Resource Locators, a type of Uniform Resource Identifier, while URIs are Uniform Resource Identifiers.
Several URIs, including URLs, identify resources by their online location. A URI identifies an abstract or physical resource and includes information about how to interact with it.
URL | URI |
URL is the address for a web page. | URI is just an identifier that is used to locate any resource on the Internet. |
URL is also called a uniform resource locator (URL). | URI stands for Uniform Resource Identifier. |
A URL is a string of characters that specifies where on the web some content is found. | It is a string character that identifies and abstract resource rather than a specific animation on the web where it exists. |
URLs typically include hostname or path information. | URIs typically include protocol information such as HTTP:// or HTTPS://. |
URL identifies an actual file on the Internet. | A URI identifies an abstract concept. |
Its primary function is to facilitate internet search queries. | It is used to specify the resources and binaries in XML and tag library files like JSTL and XSTL. |