# 如何设置301重定向 - 非www到www

**URL:** <https://meta.discourse.org/t/how-to-setup-301-redirect-non-www-to-www/179332>\
**Category:** Self-hosting\
**Created:** [2021年二月11日 13:03 UTC](https://meta.discourse.org/t/how-to-setup-301-redirect-non-www-to-www/179332 "2021-02-11T13:03:14Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [2021年二月11日 14:47 UTC](https://meta.discourse.org/t/how-to-setup-301-redirect-non-www-to-www/179332/3 "2021-02-11T14:47:55Z")

</div>

您可以使用 [forcewww.com](http://forcewww.com)，或参考 [如何在多个域名上设置 Let’s Encrypt](https://meta.discourse.org/t/setting-up-let-s-encrypt-with-multiple-domains/56685)。我不建议通过添加外部 Nginx 来解决此问题。

---

_[View the full topic](https://meta.discourse.org/t/how-to-setup-301-redirect-non-www-to-www/179332)._
