# 已恢复的网站 - 需要纠正URL，大家有办法吗？

**URL:** https://meta.discourse.org/t/restored-site-urls-need-to-be-corrected-any-ideas/350925
**Category:** Support
**Created:** [2025年二月6日 18:03 UTC](https://meta.discourse.org/t/restored-site-urls-need-to-be-corrected-any-ideas/350925 "2025-02-06T18:03:55Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![agemo](https://avatars.discourse-cdn.com/v4/letter/a/ac91a4/32.png) [@agemo](https://meta.discourse.org/u/agemo)
#### Post date: [2025年二月7日 09:38 UTC](https://meta.discourse.org/t/restored-site-urls-need-to-be-corrected-any-ideas/350925/4 "2025-02-07T09:38:24Z")

</div>

谢谢。看起来很简单。我进入了应用程序并运行了它，但似乎没有改变帖子中 URL 的实例。

这是重映射：

`RAILS_ENV=production discourse remap //https://sub.domain.com //https://domain.com`

它在“default”数据库上运行并完成，花费了几分钟，然后报告“完成”，没有错误。

我查看了一些精选帖子，但帖子上的 URL 链接似乎没有任何变化。

我重建了一些帖子进行测试，在这些帖子中我看到了 `dev.domain.com` 而不是实时链接中的 `domain.com`，但它们保持不变。

然后我运行了相同的命令，但省略了 `https://` 并收到此错误：

```plaintext
Remapping tables on default...

Error: ERROR: duplicate key value violates unique constraint "index_post_hotlinked_media_on_post_id_and_url_md5"
DETAIL: Key (post_id, md5(url::text))=(1001176, 547048fcd29cdac60) already exists.
The remap has only been partially applied due to the error above. Please re-run the script again.

```

我猜数据库中有一个聊天消息导致它停止，但不确定为什么。我想我需要以某种方式在数据库中看到它，正如你所知，我通常管理 Discourse 的方式从来不是通过数据库。

最后，我重新运行了原始的重映射，花费了几分钟并报告“完成”，没有错误：

`RAILS_ENV=production discourse remap //https://sub.domain.com //https://domain.com`

🤔

也许我需要重新烘焙帖子才能看到效果？

我以为帖子重建是逐个帖子执行的相同操作。

或者重建应用程序？

---

_[View the full topic](https://meta.discourse.org/t/restored-site-urls-need-to-be-corrected-any-ideas/350925)._
