为什么在 url 中使用 - 而不是 _ ?
url 包含 '_' 似乎没有什么不好的影响。
主机名中不允许使用下划线。因此,some_place.com 不是有效的 URL,因为主机名无效。 URL 中允许使用下划线。因此,抛开其他问题不谈,some-place.com/which_place/ 是完全合法的。
来自 RFC 1738:
host
[...] Fully qualified domain names take the form as described
in Section 3.5 of RFC 1034 [13] and Section 2.1 of RFC 1123
[5]: a sequence of domain labels separated by ".", each domain
label starting and ending with an alphanumerical character and
possibly also containing "-" characters. The rightmost domain
label will never start with a digit, though, which
syntactically distinguishes all domain names from the IP
addresses.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)