# Topic URL to include its Category

**URL:** https://meta.discourse.org/t/topic-url-to-include-its-category/39996
**Category:** Support
**Created:** [2월 22, 2016, 6:31오후 UTC](https://meta.discourse.org/t/topic-url-to-include-its-category/39996 "2016-02-22T18:31:03Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![stevenpslade](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stevenpslade/32/53550_2.png) [@stevenpslade](https://meta.discourse.org/u/stevenpslade)
#### Post date: [2월 22, 2016, 6:31오후 UTC](https://meta.discourse.org/t/topic-url-to-include-its-category/39996/1 "2016-02-22T18:31:03Z")

</div>

I am investigating the possibility of including the category in the topic URL for retargeting purposes.

For example: `https://meta.discourse.org/t/support/where-can-i-create-tags/31094` or `https://meta.discourse.org/support/t/where-can-i-create-tags/31094`

From previous responses on this subject, it seems as though this will wreck havoc on the routing system, correct?

What about the possibility of including the category in query string? `https://meta.discourse.org/t/where-can-i-create-tags/31094/?category=support`

Thoughts, suggestions, answers?

---

<div class="post-metadata">

### Author: ![tobiaseigen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tobiaseigen/32/539204_2.png) [@tobiaseigen](https://meta.discourse.org/u/tobiaseigen)
#### Post date: [2월 22, 2016, 6:48오후 UTC](https://meta.discourse.org/t/topic-url-to-include-its-category/39996/2 "2016-02-22T18:48:43Z")

</div>

I think if you put it before the topic ID at the end there’s no problem… but you can’t add more slashes or other delimiters.

Maybe you can use underscore to delimit if you need it, e.g. these two links go to the same place without any problem:

```
https://meta.discourse.org/t/topic-url-to-include-its-category/39996

https://meta.discourse.org/t/_support_topic-url-to-include-its-category/39996

```

your URL with question mark at the end might work - seems to work here. Not sure what the effect of that is.

```
https://meta.discourse.org/t/where-can-i-create-tags/31094/?category=support

```

---

<div class="post-metadata">

### Author: ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)
#### Post date: [3월 6, 2025, 10:13오전 UTC](https://meta.discourse.org/t/topic-url-to-include-its-category/39996/3 "2025-03-06T10:13:48Z")

</div>

이것이 사이트 설정이나 플러그인을 통해 가능한가요?

---

<div class="post-metadata">

### Author: ![Lockie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lockie/32/492397_2.png) [@Lockie](https://meta.discourse.org/u/Lockie)
#### Post date: [3월 6, 2025, 9:22오전 UTC](https://meta.discourse.org/t/topic-url-to-include-its-category/39996/5 "2025-03-06T09:22:26Z")

</div>

안녕하세요,

저는 Discourse는 물론 포럼 자체에 대해서도 초보자인데요, 스레드 URL에 해당 스레드의 카테고리가 포함될 수 있는지, 그리고 그것이 어떻게 가능한지 궁금해서 질문드립니다.

현재 카테고리 URL은 다음과 같은 형태입니다:  
[https://randomname.discourse.group/c/category-name/6](https://randomname.discourse.group/c/category-name/6)

하지만 해당 카테고리 안의 스레드를 클릭하면 카테고리에 대한 참조가 전혀 없는 URL이 표시됩니다:  
[https://randomname.discourse.group/t/what-a-great-thread/18](https://randomname.discourse.group/t/what-a-great-thread/18)

죄송하지만 검색을 통해 답을 찾아보려 했으나 잘 찾지 못했습니다.

도움 주시면 정말 감사하겠습니다.

감사합니다

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [3월 6, 2025, 2:56오후 UTC](https://meta.discourse.org/t/topic-url-to-include-its-category/39996/8 "2025-03-06T14:56:50Z")

</div>

명명을 올바르게 설정하기 위한 좋은 아이디어입니다. Discourse에서는 스레드를 '토픽(Topic)'이라고 부릅니다.

카테고리와의 관련성은 암묵적으로 처리되므로 별도로 지정할 필요가 없습니다.

게다가 토픽이 새로운 카테고리로 이동하면 URL이 구식이 되어 사실상 유효하지 않게 됩니다.

필요하다면 쿼리 문자열 매개변수를 추가하는 데는 보통 문제가 없습니다.

그런데 사용 사례가 무엇인가요? 무엇을 이루고자 하시나요?

---

<div class="post-metadata">

### Author: ![Lockie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lockie/32/492397_2.png) [@Lockie](https://meta.discourse.org/u/Lockie)
#### Post date: [3월 6, 2025, 3:13오후 UTC](https://meta.discourse.org/t/topic-url-to-include-its-category/39996/9 "2025-03-06T15:13:51Z")

</div>

저는 포럼을 스크래핑하는 제3자 소프트웨어를 사용하고 있습니다. 이 소프트웨어의 쿼리 기능에 제한이 있어, 스레드(토픽)를 스크래핑할 때 해당 스레드가 어떤 카테고리에 속하는지 추론해야 합니다. 소프트웨어는 URL을 통해 이를 파악하는 것으로 보입니다.

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [3월 6, 2025, 3:18오후 UTC](https://meta.discourse.org/t/topic-url-to-include-its-category/39996/10 "2025-03-06T15:18:53Z")

</div>

앞서 지적했듯이 앱의 관점에서는 의미가 없지만, 플러그인이나 스크립트를 만들어 모든 URL을 변경할 수 있을지도 모릅니다.

크롤러 뷰의 HTML에서 카테고리가 명확하게 표시되는 것 같으니, 대신 도구를 수정하여 이를 활용하는 것은 어떨까요?

---

<div class="post-metadata">

### Author: ![renato](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/renato/32/383632_2.png) [@renato](https://meta.discourse.org/u/renato)
#### Post date: [3월 6, 2025, 3:51오후 UTC](https://meta.discourse.org/t/topic-url-to-include-its-category/39996/11 "2025-03-06T15:51:33Z")

</div>

스크레이퍼에 URL을 직접 제공하고 카테고리 추출 방식을 정의하는 쪽이라면, 토비우스가 제안한 방법을 해킹으로 활용할 수 있을지 모릅니다. 예를 들어 `/t/category-name__topic-slug/topic-id`를 제공할 수 있습니다. Discourse는 `topic-id`만을 기준으로 최종 URL에 대한 301 리다이렉트 응답을 반환합니다.

하지만 스크래핑 과정에서 URL을 가져오는 것이라면, 스크래핑 전략의 한계를 충족하기 위한 변경 사항에 비해 너무 많은 작업이 필요해 보입니다.

> [@NateDhaliwal](#):
>
> 이것이 사이트 설정이나 플러그인을 통해 가능한가요?

제가 아는 한, 불가능합니다. 플러그인에서 `/t/category-name/topic-slug/topic_id` 라우트를 제공하는 것은 가능해 보이지만, Discourse 내의 모든 토픽 참조가 이 대체 라우트를 우선하도록 하는 옵션을 추가하는 것은 (개인적으로) 적은 이득에 비해 너무 많은 작업이 필요해 보입니다.

---

<div class="post-metadata">

### Author: ![Heliosurge](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/heliosurge/32/571810_2.png) [@Heliosurge](https://meta.discourse.org/u/Heliosurge)
#### Post date: [3월 7, 2025, 10:13오전 UTC](https://meta.discourse.org/t/topic-url-to-include-its-category/39996/12 "2025-03-07T10:13:39Z")

</div>

생각은 이런데, RSS 피드를 사용해 보신 적 있으신가요? Discourse에는 RSS 피드 출력이 기본적으로 내장되어 있습니다.

> [@Discourse RSS 피드 찾기](https://meta.discourse.org/t/finding-discourse-rss-feeds/264134?u=heliosurge):
>
> bookmark Discourse에서 사용할 수 있는 모든 RSS 피드의 포괄적인 참고 가이드입니다. URL 구조, 인증 요구 사항, 피드 리더를 위한 모범 사례를 포함합니다. person_raising_hand 필요한 사용자 권한: 모든 사용자 RSS(Really Simple Syndication)는 콘텐츠가 사이트와 플랫폼 간에 쉽게 공유될 수 있도록 하는 표준화된 컴퓨터 판독 가능 형식입니다. Discourse는 주제, 게시물, 카테고리, 태그, 사용자, 그룹에 대해 다양한 RSS 피드를 제공합니다. information_source 안정적인 URL: ID(예: 카테고리 ID, 주제 ID, 배지 ID)를 포함하는 RSS 링크는 해당 ID로 정의됩니다. “슬러그”(URL의 텍스트 부분)가 변경되어도 링크가 깨지지 않지만, 슬러그는 여전히 URL 경로에서 필수입니다. 예를 들어, 다음 링크는 모두 동일한 RSS 피드로 연결됩니다: https://meta.…

---

<div class="post-metadata">

### Author: ![j127](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j127/32/79093_2.png) [@j127](https://meta.discourse.org/u/j127)
#### Post date: [3월 7, 2025, 6:29오후 UTC](https://meta.discourse.org/t/topic-url-to-include-its-category/39996/13 "2025-03-07T18:29:10Z")

</div>

> [@Lockie](#):
>
> 스레드(토론)를 스크레이핑할 때 해당 스레드가 속한 카테고리를 추론해야 하는데, URL을 통해 그렇게 하는 것으로 보입니다.

어떤 소프트웨어를 사용하시나요? URL을 변경하지 않고도 HTML과 JSON을 통해 카테고리를 가져올 수 있는 방법이 몇 가지 있습니다.

JSON의 경우, 이 주소를 스크레이핑하는 것:  
`https://meta.discourse.org/t/topic-url-to-include-its-category/39996`

대신 이 주소를 스크레이핑하세요:  
`https://meta.discourse.org/t/topic-url-to-include-its-category/39996.json`

그리고 `category_id` 필드를 찾으시면 됩니다.

또 다른 방법으로는 [Data Explorer](https://meta.discourse.org/t/32566?silent=true)를 사용하여 필요한 데이터를 추출하는 것이 있습니다.
