Remove WWW prefix from your website

前端 未结 9 686
情歌与酒
情歌与酒 2020-12-28 19:24

How does Stack Overflow (and other web sites) remove the \'www\' prefix when it\'s entered as part of a URL?

Is it a redirect, a rewrite or something else entirely?<

9条回答
  •  情深已故
    2020-12-28 20:17

    This is going a long way back, but as far as I know this is a DNS setup. I think you don't need to specify a HOST address (WWW is the name of the host (or computer/cluster...) that the site resides on/in.).

    I think you can then set it up to send all requests to a default host.

    Not 100% sure, but check out what is possible with DNS.

    Hope that helps or at least get's you going in the right direction.

提交回复
热议问题