What variations of WWW part from the URL's host name exist?

前端 未结 2 1294
忘了有多久
忘了有多久 2020-12-04 03:42

Most URLs on the web can begin with the www. part:

http://www.example.com

or without it:

htt

相关标签:
2条回答
  • 2020-12-04 04:15

    You are talking about the third-level domain, typically called subdomain. In DNS speak it’s a label.

    Such a DNS label can contain up to 63 characters, consisting of

    • a-z
    • A-Z (however, they are interpreted case-insensitive)
    • 0-9
    • -

    (Internationalized domain name would allow for more characters, but technically the same character set is used, see Punycode.)

    Using www is a very common convention, but in no way required.

    A popular example with a different subdomain is Wikipedia. The English Wikipedia has the hostname en.wikipedia.org, i.e., they use en (in their case representing the language code for English) instead of www.

    Because www is so common and many people add it to all URLs when typing them, websites typically adapt to it: either by providing both variants (with and without www), or by redirecting from one variant to the other. (The latter is usually preferred because having canonical URLs is useful for many reasons.)

    Note that domains don’t have to stop at the third level, you can have more levels, like fifth.fourth.third.example.com. Some sites even use the www convention for such domains, so they’d add www to any domain, e.g. www.fifth.fourth.third.example.com.

    0 讨论(0)
  • 2020-12-04 04:20

    It is something you configure in the webserver. Commonly, they contain a different site or are alias to the main site, taking into account typos the users may make, but yes, it is arbitrary.

    0 讨论(0)
提交回复
热议问题