What is the URL?
A URL is a global address of documents & protocols lớn retrieve resource on a computer network. URLs occur most frequently in reference to lớn website pages (HTTP) but can also be used for database access using JDBC, email (mailto), file transfer (FTP), & many other applications. URL stands for Unisize Resource Locator. In this URL Vs. URI tutorial, you will learn:
What is URI?
A URI is a string containing characters that identify a physical or logical resource. URI follows syntax rules khổng lồ ensure uniformity. Moreover, it also maintains extensibility via a hierarchical naming scheme. The full form of URI is Uniform Resource Identifier.Bạn đang xem: Uri và url

KEY DIFFERENCES:
URL is a subset of URI that specifies where a resource exists & the mechanism for retrieving it, while URI is a supermix of URL that identifies a resource The main ayên ổn of URL is lớn get the location or address of a resource whereas the main alặng of URI is to lớn find a resource.URL is used lớn locate only website pages, on the other h&, URI in used in HTML, XML & other files.URL contains components such as protocol, domain name, path, hash, query string, etc. while, URI contains components lượt thích scheme, authority, path, query, etc.Ven Diagram of URIs and URL

Syntax of URL
Here is a Syntax of URL: http://www.domainname.com/folder-name/web page-file-name.htm We can divide the above sầu URL into lớn the following parts: Protocol: It is the first part of the URL. Here, the protocol name is Hypertext Transfer Protocol (HTTP).Xem thêm: Ctrl F5 Là Gì - Tác Dụng Tổ Hợp Phím Ctrl + F5 Đối Với Dev
http://www.domainname.com/: It is your domain name. It is also known as server id or the host. /folder-name/: It indicates that the website page referenced in "filed" in a given thư mục on the webhệ thống.web-page-file-name.htm: It is actually a web page file name. The ".htm" is an extension for the HTML tệp tin, which shows that it is a static web page. File names can have different extensions or it is depend on how you have mix up a web VPS. There could be no extension at all, and the URL could end with a slash line (/).Example: This example URL has a folder but no extension https://career.balkanpoliticalclub.net/category/heavy-industries/This example URL has no folder https://www.balkanpoliticalclub.net/what-is-sap.htmlThis example URL has no extension https://career.balkanpoliticalclub.net/top-33-investment-banking-interview-questions-answers/Syntax of URI
Here is a syntax of URI: URI = scheme:/authority>path<#fragment> The URI includes the following parts: Scheme component: It is a non-empty component followed by a colon (:). Scheme contains a sequence of characters starting with a letter & followed by any combination of digits, letters, period (.), hyphen (-), or plus (+). Examples of well-known schemes include HTTPhường., HTTPS, mailto lớn, tệp tin, FTPhường., etc. URI schemes must be registered with the Internet Assigned Numbers Authority (IANA). Authority component: It is an optional field and is preceded by //. It consists of Optional userinfo subcomponent that might consist of a username & password (optional). A host subcomponent containing either an IPhường address or a registered name. An optional port subcomponent that is followed by a colon (:)Path: A path contains a sequence of segments that are separated by a slash. Query component: It is optional và preceded by a question mark (?). Query component contains a query string of non-hierarchical data. Fragment component: It is an optional field và preceded by a hash (#). Fragment component includes a fragment identifier giving direction lớn a secondary resource. Example of URI No protocol mentioned www.balkanpoliticalclub.netDomain not mentioned what-is-sap.htmlProtocol mentionsldap://<2001:db8::7>/c=GB?objectClass?onemailto:This tin nhắn address is being protected from spambots. You need JavaScript enabled lớn view it. tel:+1-816-555-1212 telnet://192.0.2.16:80/
Confusion about URN
There is a confusion about URN that, if you implement protocols lượt thích https, ftp, etc, then it is called a URL, even though it is a URI. The problem with such a debate is that appropriate RFC are extremely dense & sometimes even contradictory. For example, RFC 3986 says, URI can be either a name, locator or both.Why URL?
Here are the important reasons of using URL: The Information written in the URL gives you the ability to switch from one web page lớn another with just one mouse cliông chồng.URL tells you how to lớn access a particular resource.Whenever you type a URL into your browser or cliông chồng any hypertext link, your web browser sends a request lớn a website server to tải về one or more files.Every URL is unique and identifies one particular file.A trang web URL or domain is one of the most crucial parts of your website. By using simple words or string that usually end with a .org, .com, or .net, you would be able to lớn get traffic to your website.Why URI?
Here are the important reasons of using URI: A Uniform Resource Identifier is essential khổng lồ the semantic website because it prevents ambiguity. A URI search the name as well as the location of a resource or file, which is in a uniform format. It has a string of characters for the specific filename and path.URI provides a method for resources khổng lồ be accessed by other systems over the World Wide Web or across a network. It is used by web browsers and P2P.. (Peer lớn Peer) file-sharing software khổng lồ find & tải về files.URI allows new file types to be defined without affecting old files you have sầu.You can assign a single resource to associate with multiple representations.URL Vs. URI

URL | URI |
URL stands for Unikhung Resource Locator. | URI stands for Unikhung Resource Identifier. |
URL is a subset of URI that specifies where a resource is exists and the mechanism for retrieving it. | A URI is a superset of URL that identifies a resource either by URL or URN (Unisize Resource Name) or both. |
The main aim is to get the location or address of a resource | The main ayên ổn of URI is to lớn find a resource và differentiate it from other resources using either name or location. |
URL is used to lớn locate only website pages | Used in HTML, XML & other files XSLT (Extensible Stylesheet Language Transformations) & more. |
The scheme must be a protocol lượt thích HTTPhường, FTP, HTTPS, etc. | In URI, the scheme may be anything lượt thích a protocol, specification, name, etc. |
Protocol information is given in the URL. | There is no protocol information given in URI. |
Example of URL: https://google.com | Example of URI: urn:isbn:0-486-27557-4 |
It contains components such as protocol, domain, path, hash, query string, etc. | It contains components lượt thích scheme, authority, path, query, fragment component, etc. |
All URLs can be URIs | Not all URIs are URLs since a URI can be a name instead of a locator. |