为什么我看到的一些网站的形式是URL a.b.example
,而另一些是形式的b.example/a
?
例如,为什么用它gist.github.com
代替github.com/gist
?
为什么我看到的一些网站的形式是URL a.b.example
,而另一些是形式的b.example/a
?
例如,为什么用它gist.github.com
代替github.com/gist
?
这些是不同的组件。有关组件及其定义的列表,请参阅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:
http://www.ebay.de/
for Germany, http://www.ebay.it/
for Italy)http://alice.tumblr.com/
for Alice, http://bob.tumblr.com/
for Bob)https://twitter.com/alice
for Alice, https://twitter.com/bob
for Bob)https://en.wikipedia.org/
英语、https://fr.wikipedia.org/
法语)