0

为什么我看到的一些网站的形式是URL a.b.example,而另一些是形式的b.example/a

例如,为什么用它gist.github.com代替github.com/gist

4

1 回答 1

2

这些是不同的组件。有关组件及其定义的列表,请参阅URI 标准的第 3 节。

https://gist.github.com/
  • 权限(或更具体地说,主机gist.github.com.
  • 路径/。_
https://github.com/gist
  • 权限(或更具体地说,主机github.com.
  • 路径/gist。_

由于https://gist.github.com/通常还有第二个 URI 之类的路径(例如,https://gist.github.com/foobar),我猜您主要对权限组件感兴趣。

在您的示例中,使用了DNS,即这些是domain,它们由标签组成,由分隔.

  • gist是一个三级域又名子域
  • github二级域名
  • com顶级域(TLD)

顶层控制第二层,第二层控制第三层,以此类推。因此,如果您购买域名github.com,您通常可以控制其所有三级域(和四级等)。

It’s up to the webmaster which kind of URI design gets used, and the decision can depend on many different factors: what is technically possible for them and the systems they use, usability (example), SEO (example), etc. A common reason for using different host names (domains) is that they can be easily hosted on different servers.

Examples:

  • eBay uses different (top-level) domains for each of their localized sites (e.g., http://www.ebay.de/ for Germany, http://www.ebay.it/ for Italy)
  • Tumblr uses a subdomain for each of their users (e.g., http://alice.tumblr.com/ for Alice, http://bob.tumblr.com/ for Bob)
  • Twitter uses a path segment for each of their users (e.g., https://twitter.com/alice for Alice, https://twitter.com/bob for Bob)
  • 维基百科使用不同语言的子域(例如,https://en.wikipedia.org/英语、https://fr.wikipedia.org/法语)
于 2016-09-17T17:25:24.277 回答