When should one use a 'www' subdomain?

前端 未结 8 1992
陌清茗
陌清茗 2020-11-30 16:58

When browsing through the internet for the last few years, I\'m seeing more and more pages getting rid of the \'www\' subdomain.

Are there any good reasons to use or

8条回答
  •  旧时难觅i
    2020-11-30 17:31

    There are several reasons, here are some:

    1) The person wanted it this way on purpose

    People use DNS for many things, not only the web. They may need the main dns name for some other service that is more important to them.

    2) Misconfigured dns servers

    If someone does a lookup of www to your dns server, your DNS server would need to resolve it.

    3) Misconfigured web servers

    A web server can host many different web sites. It distinguishes which site you want via the Host header. You need to specify which host names you want to be used for your website.

    4) Website optimization

    It is better to not handle both, but to forward one with a moved permanently http status code. That way the 2 addresses won't compete for inbound link ranks.

    5) Cookies

    To avoid problems with cookies not being sent back by the browser. This can also be solved with the moved permanently http status code.

    6) Client side browser caching

    Web browsers may not cache an image if you make a request to www and another without. This can also be solved with the moved permanently http status code.

提交回复
热议问题