# 서브폴더 설치에서 「전체 게시물 보기」 버튼이 작동하지 않음

**URL:** https://meta.discourse.org/t/show-full-post-button-doesnt-work-in-subfolder-installations/390811
**Category:** Support
**Tags:** embedding, subfolder
**Created:** [12월 9, 2025, 6:21오후 UTC](https://meta.discourse.org/t/show-full-post-button-doesnt-work-in-subfolder-installations/390811 "2025-12-09T18:21:00Z")
**Posts on this page:** 1
**Showing post:** 20

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [12월 13, 2025, 12:52오후 UTC](https://meta.discourse.org/t/show-full-post-button-doesnt-work-in-subfolder-installations/390811/20 "2025-12-13T12:52:25Z")

</div>

여러분, 다시 트레일링 슬래시(trailing slash) 문제가 발생한 것 같네요 🙂

> [트레일링 슬래시가] 주요 문제인 것으로 보입니다. [JavaScript를 사용하여 다른 웹사이트에 Discourse 댓글을 임베드할 때](https://meta.discourse.org/t/embed-discourse-comments-on-another-website-via-javascript/31963)는 이를 파라미터로 제어할 수 있으며, 수정하기가 매우 쉽습니다.

참고로 Discourse의 모든 토픽 임베드는 `embed_url`에서 트레일링 슬래시를 제거합니다. [TopicEmbed.normalize\_url](https://github.com/discourse/discourse/blob/main/app/models/topic_embed.rb#L30)을 참조하세요. JavaScript 임베드와 [WP Discourse](https://github.com/discourse/wp-discourse) 임베드가 교차하는 별도의 사례로 인해, 우리는 두 임베드 방식 모두에서 이 처리 방식을 표준화했습니다. [Apply TopicEmbed url normalisation to embed urls inserted in the PostCreator - Pull Request #30641%EC%9D%84 - discourse/discourse - GitHub](https://github.com/discourse/discourse/pull/30641%EC%9D%84) 참조하세요.

@Thiago_Mobilon 이 과정에서 Discourse도 업데이트하셨나요? Discourse 업데이트가 서브폴더 설치로 이전한 시점과 동시에 이루어졌기 때문에, [WP Discourse](https://github.com/discourse/wp-discourse) 임베드에 대한 `embed_url` 정규화 표준화가 여기에도 적용되고 있는 것으로 보입니다. 현재 실행 중인 Discourse 버전은 무엇인가요? (이전 버전이 무엇이었는지 아신다면 그것도 알려주세요.)

참고로 최신 버전의 Discourse에서 로컬로 이 두 명령어를 실행하면 동일한 결과를 얻습니다. 즉, 아티클의 HTML 본문이 반환됩니다.

```ruby
# 트레일링 슬래시가 있는 경우
TopicEmbed.find_remote("https://tecnoblog.net/noticias/governo-renova-app-da-cnh-para-baratear-obtencao-do-documento/")

# 트레일링 슬래시가 없는 경우
TopicEmbed.find_remote("https://tecnoblog.net/noticias/governo-renova-app-da-cnh-para-baratear-obtencao-do-documento")

# 동일한 결과를 생성

```

혹시 WordPress 쪽에서 변경 사항을 적용하셨나요?

\*\* 수정 이 토픽을 좀 더 자세히 읽어보니, 문제가 Discourse를 서브폴더 설치로 이전하거나 트레일링 슬래시 때문이 아니라, WordPress URL을 마이그레이트한 것 때문일 수 있습니다. 즉,

> 예를 들어, [이 게시물](https://tecnoblog.net/comunidade/t/o-que-e-pirataria-digital-entenda-as-consequencias-dos-conteudos-piratas/45628)에서 사용된 URL은 이전에는 다음과 같았습니다:
> 
> [https://tecnoblog.net/486925/o-que-e-pirataria-digital/](https://tecnoblog.net/486925/o-que-e-pirataria-digital/)
> 
> 이제 다음과 같이 변경되었습니다:
> 
> [https://tecnoblog.net/responde/o-que-e-pirataria-digital/](https://tecnoblog.net/responde/o-que-e-pirataria-digital/)

따라서 문제는 `topic_embeds.embed_url`에 구식 URL 구조가 저장되어 있고, `FinalDestination`이 어떤 이유에서인지(즉, 리다이렉트를 따를 수 없어서) 새 URL을 해결하지 못하는 것일 수 있습니다.

그 경우, 구식 블로그 URL이 새 블로그 URL로 리다이렉트되도록 하거나 `topic_embeds.embed_url`을 마이그레이션해야 합니다. 마이그레이션 측면에서, 여러분의 스크립트는 부정확합니다. 예를 들어 `topic.custom_fields["embed_url"]`은 `embed_url`이 저장되는 곳이 아닙니다.

리다이렉트 대신 마이그레이션 경로를 선택하시려면 다음을 제안합니다. 먼저 `topic_embeds.embed_url`의 잘못된 블로그 URL 형식이 문제임을 확인하기 위해 예를 확인하세요. 예: `TopicEmbed.find_by(topic_id: 157441)`. 그런 다음, 해당 컬럼에 구식 URL 형식이 저장되어 있음을 확인하면, 특정 카테고리의 모든 구식 형식 `embed_url`을 업데이트하기 위해 다음을 실행하세요:

```ruby
category_id = # 여기에 카테고리 ID 입력
TopicEmbed.joins(:topic).where(topics: { category_id: category_id }).find_each do |embed|
   new_url = embed.embed_url.sub(%r{/\d+/}, "/responde/")
   embed.update!(embed_url: new_url) if new_url != embed.embed_url
 end

```

구식 형식에서 새 형식으로의 정규식 치환(`sub(%r{/\d+/}, "/responde/")`)은 제공하신 예시에 기반한 추측일 뿐입니다. 실제 URL에 대한 효과를 여기서 테스트할 수 있습니다: [https://regex101.com/](https://regex101.com/)

---

_[View the full topic](https://meta.discourse.org/t/show-full-post-button-doesnt-work-in-subfolder-installations/390811)._
