URL 路径中包含多个句点的 URL 是否有效?
Are URLs with multiple periods in the URL path valid?
我想知道以下网址是否有效。
路径中的点,在主机之后:
http://www.example.com/v.b.w..com
主机中的点,作为子域的一部分:
http://v.b.w..co.manufacturer.example.com/
nslookup 会告诉您它是否是合法名称。
我 运行 以下 Ubuntu 16.04.1 LTS
$ nslookup http://v.b.w..co.manufacturer.domain.com/
nslookup: 'http://v.b.w..co.manufacturer.domain.com/' is not a legal name (empty label)
1。路径中的..
有效(example.com/v.b.w..com
):
RFC 3986 allows it, and even lists it in its abnormal examples:
Within a representation with a well defined base URI of
http://a/b/c/d;p?q
a relative reference is transformed to its target URI as follows.
⋮
"g.." = "http://a/b/c/g.."
"..g" = "http://a/b/c/..g"
请注意 /../
将无效,因为 URL 将被解释为具有相对部分 - link 到 a/b/../c
就像 link 到 a/c
.
2。 ..
中的sub-domain无效(http://no..bad.example.com
):
来自 RFC 1738 - Uniform Resource Locators (URL),第 5 节,BNF 用于特定 URL 方案:
host = hostname | hostnumber
hostname = *[ domainlabel "." ] toplabel
domainlabel = alphadigit | alphadigit *[ alphadigit | "-" ] alphadigit
令牌之间只允许有一个句点。
我想知道以下网址是否有效。
路径中的点,在主机之后:
http://www.example.com/v.b.w..com
主机中的点,作为子域的一部分:
http://v.b.w..co.manufacturer.example.com/
nslookup 会告诉您它是否是合法名称。
我 运行 以下 Ubuntu 16.04.1 LTS
$ nslookup http://v.b.w..co.manufacturer.domain.com/
nslookup: 'http://v.b.w..co.manufacturer.domain.com/' is not a legal name (empty label)
1。路径中的..
有效(example.com/v.b.w..com
):
RFC 3986 allows it, and even lists it in its abnormal examples:
Within a representation with a well defined base URI of
http://a/b/c/d;p?q
a relative reference is transformed to its target URI as follows.
⋮
"g.." = "http://a/b/c/g.."
"..g" = "http://a/b/c/..g"
请注意 /../
将无效,因为 URL 将被解释为具有相对部分 - link 到 a/b/../c
就像 link 到 a/c
.
2。 ..
中的sub-domain无效(http://no..bad.example.com
):
来自 RFC 1738 - Uniform Resource Locators (URL),第 5 节,BNF 用于特定 URL 方案:
host = hostname | hostnumber
hostname = *[ domainlabel "." ] toplabel
domainlabel = alphadigit | alphadigit *[ alphadigit | "-" ] alphadigit
令牌之间只允许有一个句点。