18143453325 在线咨询 在线咨询
18143453325 在线咨询
所在位置: 首页 > 营销资讯 > 建站知识 > URL是什么意思?

URL是什么意思?

时间:2023-02-14 21:54:01 | 来源:建站知识

时间:2023-02-14 21:54:01 来源:建站知识

这个维基百科上有翻译。

URL 是一种比较统一的带参数指向某个地址的格式。格式为:

[协议类型]://[访问资源需要的凭证信息]@[服务器地址]:[端口号]/[资源层级UNIX文件路径][文件名]?[查詢]#[片段ID]
比如这个问题,URL 是

https://www.zhihu.com/question/324392663https 是协议,使用默认账户访问,端口是 https 默认的 443,路径是 /question/324392663。




如果要寻找精准定义,我们可以翻 RFC。URL 的 RFC 是 rfc1738 。

它自己介绍道

The specification is derived from concepts introduced by the World-Wide Web global information initiative, whose use of such objects dates from 1990 and is described in "Universal Resource Identifiers in WWW", RFC 1630. The specification of URLs is designed to meet the requirements laid out in "Functional Requirements for Internet Resource Locators"
在 RFC 1630 中有对 URL,URI,URN 的区分如下:

URIs
This document defines a way to encapsulate a name in any registered name space, and label it with the the name space, producing a member of the universal set. Such an encoded and labelled member of this set is known as a Universal Resource Identifier, or URI.
The universal syntax allows access of objects available using existing protocols, and may be extended with technology.
The specification of the URI syntax does not imply anything about the properties of names and addresses in the various name spaces which are mapped onto the set of URI strings. The properties follow from the specifications of the protocols and the associated usage conventions for each scheme.

URLs
For existing Internet access protocols, it is necessary in most cases to define the encoding of the access algorithm into something concise enough to be termed address. URIs which refer to objects accessed with existing protocols are known as "Uniform Resource Locators" (URLs) and are listed here as used in WWW, but to be formally defined in a separate document.

URNs
There is currently a drive to define a space of more persistent names than any URLs. These "Uniform Resource Names" are the subject of an IETF working group's discussions. (See Sollins and Masinter, Functional Specifications for URNs, circulated informally.)
The URI syntax and URL forms have been in widespread use by World-Wide Web software since 1990.
-- https://tools.ietf.org/html/rfc1630
太长谁帮我翻译下... 简单说,我们可以看到,URL 是 URI 的一部分,不过因为特别重要,用于 WWW 中,所以单独列出来,放在 rfc1738 中。

那么,如何定义“用于 WWW 范畴” 呢?rfc1738 列举了一些例子:

3. Specific Schemes

The mapping for some existing standard and experimental protocols is
outlined in the BNF syntax definition. Notes on particular protocols
follow. The schemes covered are:

ftp File Transfer protocol
http Hypertext Transfer Protocol
gopher The Gopher protocol
mailto Electronic mail address
news USENET news
nntp USENET news using NNTP access
telnet Reference to interactive sessions
wais Wide Area Information Servers
file Host-specific file names
prospero Prospero Directory Service

Other schemes may be specified by future specifications. Section 4 of
this document describes how new schemes may be registered, and lists
some scheme names that are under development.
因此它指向网上的地址,但并不特指我们的网页。

Section 4 中提到的维护了一组 schema 全集。我们可以在这个地方找到一个 “URI schemas” 但 url schemas 并没有找到。我怀疑这是改名了的缘故。

此外,很多产品还可以按照这个规则自定义 URL。比如 jdbc 登录 mysql。mysql 是一个数据库,通过 jdbc 访问可以用一个字符串代表所有连接信息。

比如 connection URL 为 jdbc:mysql://sandy:secret@host1:3306/sakila?key1=value1&key2=value2

协议为 jdbc:mysql 用户 sandy 口令 secret 地址 host1 端口 3306 数据库 sakila,其余参数 key1:value1, key2:value2 等等。

此外,mongo 等各种数据库也有类似的连接字符串。

URI 的定义在 rfc3986 中。在 rfc3986 中列出一系列例子:

1.1.2. Examples

The following example URIs illustrate several URI schemes and
variations in their common syntax components:

ftp://ftp.is.co.za/rfc/rfc1808.txt

http://www.ietf.org/rfc/rfc2396.txt

ldap://[2001:db8::7]/c=GB?objectClass?one

mailto:John.Doe@example.com

news:comp.infosystems.www.servers.unix

tel:+1-816-555-1212

telnet://192.0.2.16:80/

urn:oasis:names:specification:docbook:dtd:xml:4.1.2
我们可以看到 URL 的各种格式也在其中,不过还有 urn 的一些格式。

综上,我们可以结论如下:

  1. URL 俗称网页地址,网址,直译统一资源定位符,但网页地址并不只是 http 和 https
  2. 网址( URL ) 和链接 ( Link ),超链接(Hyperlink) 关系有点微妙...
  3. URL 是相对古老的名称,我们简单讲 URL == 网页地址也行。不过这种格式被广泛使用,它们也自称 URL。rfc 虽然要求需要向 iana 提供文档,不过由于是内部使用,你说人家不是 URL 这个有点吹毛求疵
  4. 现在很多直接称其为 URI,直译统一资源标识符。它包括 URL 的所有内容,以及 URN 的部分。这个也完全没问题
  5. 不纠结
欢迎讨论。

参考:



关键词:

74
73
25
news

版权所有© 亿企邦 1997-2025 保留一切法律许可权利。

为了最佳展示效果,本站不支持IE9及以下版本的浏览器,建议您使用谷歌Chrome浏览器。 点击下载Chrome浏览器
关闭