# パーマリンクをトピックの最初の投稿ではなく、トピックURLを指すように修正

**URL:** <https://meta.discourse.org/t/fix-permalinks-to-point-to-topic-url-and-not-to-first-post-of-topic/218262>\
**Category:** Migration\
**Created:** [2022 年 2 月 15 日午後 4:38 UTC](https://meta.discourse.org/t/fix-permalinks-to-point-to-topic-url-and-not-to-first-post-of-topic/218262 "2022-02-15T16:38:35Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![cocococosti](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cocococosti/32/231474_2.png) [@cocococosti](https://meta.discourse.org/u/cocococosti)\
**Post date:** [2022 年 2 月 15 日午後 6:06 UTC](https://meta.discourse.org/t/fix-permalinks-to-point-to-topic-url-and-not-to-first-post-of-topic/218262/2 "2022-02-15T18:06:56Z")

</div>

> [@rrit](#):
>
> カスタマイズされた移行の後、多くのパーマリンクがトピックのURL自体ではなく、トピック内の最初の投稿を指していました。

パーマリンクはどのように作成しましたか？

例えば、[discourse/script/import\_scripts/vanilla\_mysql.rb at main · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/main/script/import_scripts/vanilla_mysql.rb#L545) では、投稿番号を具体的にチェックしており、それが1の場合は投稿番号が（NULLのまま）渡されないため、パーマリンクは最初の投稿を指すべきではありません。

---

_[View the full topic](https://meta.discourse.org/t/fix-permalinks-to-point-to-topic-url-and-not-to-first-post-of-topic/218262)._
