Why do some websites I see have a URL in the form a.b.example
, and others are in the form of b.example/a
?
For example, why is it gist.github.com
instead of github.com/gist
?
These are different components. See section 3 of the URI standard for a list of components and their definitions.
https://gist.github.com/
gist.github.com
./
.https://github.com/gist
github.com
./gist
.As https://gist.github.com/
would typically also have paths like the second URI (e.g., https://gist.github.com/foobar
), I guess you are primarily interested in the authority component.
In your examples, the DNS gets used, i.e., these are domains, which consist of labels, separated by .
:
gist
is a third-level domain (aka. subdomain)github
is a second-level domaincom
is a top-level domain (TLD)The top level controls the second level, the second level controls the third level, and so on. So if you buy the domain name github.com
, you typically have control about all of its third-level domains (and fourth-level, etc.).
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/
for English, https://fr.wikipedia.org/
for French)