# 无法更改域名

**URL:** <https://meta.discourse.org/t/unable-to-change-domain-name/166139>\
**Category:** Self-hosting\
**Created:** [2020 年10 月 3 日 20:05 UTC](https://meta.discourse.org/t/unable-to-change-domain-name/166139 "2020-10-03T20:05:27Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

作者： ![bjrno](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bjrno/32/196049_2.png) [@bjrno](https://meta.discourse.org/u/bjrno)\
发布日期： [2020 年10 月 3 日 20:05 UTC](https://meta.discourse.org/t/unable-to-change-domain-name/166139/1 "2020-10-03T20:05:27Z")

</div>

大家好，

我按照教程在 DigitalOcean Droplet 上安装了 Discourse，运行非常顺利。

安装时使用的是 `discourse.mydomain.com`，但现在我想将其迁移到不带子域名的 `mydomain.com`。  
显然，我已经正确设置了 DNS 记录，并通过从我的电脑和 Droplet 的命令行 ping 域名确认了更改已生效。一切正常。  
我还将域名添加到了 Droplet 中。  
我编辑了 `app.yml` 并修改了主机名，然后执行了 `./launcher rebuild app`（已经重复了上百次）。

但之后，我的 Discourse 站点无论是通过旧 URL 还是新 URL 都无法访问。  
如果我再次编辑 `app.yml` 并恢复原来的子域名后重新构建，站点又能正常工作了。

我已经花了三个小时尝试解决这个问题，肯定遗漏了什么简单的步骤。有人能告诉我我漏掉了什么吗？

谢谢，  
Björn

---

_[View the full topic](https://meta.discourse.org/t/unable-to-change-domain-name/166139)._
