# 如何编辑 .htaccess 文件？

**URL:** <https://meta.discourse.org/t/how-can-i-edit-htaccess-file/138316>\
**Category:** Self-hosting\
**Created:** [2020年一月11日 13:22 UTC](https://meta.discourse.org/t/how-can-i-edit-htaccess-file/138316 "2020-01-11T13:22:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![eextra](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eextra/32/170266_2.png) [@eextra](https://meta.discourse.org/u/eextra)\
**Post date:** [2020年一月11日 13:22 UTC](https://meta.discourse.org/t/how-can-i-edit-htaccess-file/138316/1 "2020-01-11T13:22:17Z")

</div>

也许有点傻，但 .htaccess 文件在哪里？

---

<div class="post-metadata">

**Author:** ![Johani](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/johani/32/176920_2.png) [@Johani](https://meta.discourse.org/u/Johani)\
**Post date:** [2020年一月11日 14:32 UTC](https://meta.discourse.org/t/how-can-i-edit-htaccess-file/138316/2 "2020-01-11T14:32:02Z")

</div>

Discourse 中没有 `.htaccess` 文件，因为我们不使用 Apache。

您想实现什么目标？

---

<div class="post-metadata">

**Author:** ![ChrisNYC](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chrisnyc/32/199229_2.png) [@ChrisNYC](https://meta.discourse.org/u/ChrisNYC)\
**Post date:** [2021年三月2日 13:38 UTC](https://meta.discourse.org/t/how-can-i-edit-htaccess-file/138316/3 "2021-03-02T13:38:56Z")

</div>

你好 @Johani，我可以在我的 Ghost 博客中嵌入托管在 Discourse 上的评论，但无法嵌入自托管的 Discourse 评论（结果是一个空白 div）——尽管两者的镜像设置完全一致。这是否可能是 Digital Ocean（Ubuntu 20.04）服务器上的 CORS 问题？

---

<div class="post-metadata">

**Author:** ![Steven](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/steven/32/187890_2.png) [@Steven](https://meta.discourse.org/u/Steven)\
**Post date:** [2021年三月2日 14:33 UTC](https://meta.discourse.org/t/how-can-i-edit-htaccess-file/138316/4 "2021-03-02T14:33:02Z")

</div>

我并不是 CORS 方面的专家，但你检查过 Discourse 中的 `cors origins` 设置了吗？添加你的 Ghost 网址可能会有所帮助。
