# Www.example.com 正常，但 example.com 不行

**URL:** https://meta.discourse.org/t/www-example-com-ok-but-example-com-not/127583
**Category:** Self-hosting
**Created:** [2019年九月4日 08:53 UTC](https://meta.discourse.org/t/www-example-com-ok-but-example-com-not/127583 "2019-09-04T08:53:53Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [2019年九月4日 11:23 UTC](https://meta.discourse.org/t/www-example-com-ok-but-example-com-not/127583/3 "2019-09-04T11:23:02Z")

</div>

很可能不止这些。如果你使用 HTTPS（你应该这样做！），还需要处理 Let’s Encrypt 和代理才能让这一切正常工作。

参见：

> [@Set up Let’s Encrypt with multiple domains / redirects](https://meta.discourse.org/t/setting-up-let-s-encrypt-with-multiple-domains/56685):
>
> NOTE: @pfaffman says: This page needs to be cleaned up. There is now a new ENV setting that will let you add more hostnames. In your app.yml under your DISCOURSE\_HOSTNAME line (it can go many places but that one makes sense), add DISCOURSE\_HOSTNAME\_ALIASES: domain.com,other.domain.com and early reports suggest that you’ll get valid certs for those domains and that accessing https://domain.com will properly redirect you to your DISCOURSE\_HOSTNAME without a certificate error. If you do that an…

如果我是你，我会保持简单，只使用一个域名。

---

_[View the full topic](https://meta.discourse.org/t/www-example-com-ok-but-example-com-not/127583)._
