首页 > 解决方案 > Are there official names sub parts of a full url?

问题描述

I would like to clear up some terminology related to the name of different parts of a web address. I'm pretty sure about these

+-------------------------+-----------+
|         Example         |   Name    |
+-------------------------+-----------+
| foo.com                 | domain    |
| www                     | subdomain |
| http://                 | protocol  |
| 8000                    | port      |
| http://www.foo.com:8000 | url       |
+-------------------------+-----------+

However I do not know if these have official names:

+---------------------+--------------------+--------------+
|     Description     |      Example       | Name         |
+---------------------+--------------------+--------------+
| no protocol or port | www.foo.com        | hostname?    |
| no port             | http://www.foo.com | url?         |
| no protocol         | www.foo.com:443    | ?            |
| domain no extension | foo                | ?            |
+---------------------+--------------------+--------------+

标签: httpurlweb

解决方案


完整绝对 url 的正式名称实际上是一个 URI。

相对 url 的正式名称是 URI Reference。

  • http 是计划
  • foo.comuser@foo.comfoo.com:80称为authorityauthorityhost和的port组合user
  • /foo/barpath
  • ?foo=bar是个query
  • #foofragment

这大致意思是:

https://user@example.org:80/foo/bar?foo=bar#foo
scheme://user@host:port/path?query#fragement
schema://authority/path?query#fragment

据我所知,子域不是官方术语。

不同的方案有不同的规则。这也是一个uri:

mailto:foo@example.org

在这种情况下:

  1. mailto:scheme
  2. foo@example.orgpath
  3. 没有权限或主机部分(尽管有主机名)。

参考:


推荐阅读