# id 없이 slug만 URL로 사용하기

**URL:** https://meta.discourse.org/t/using-slug-only-as-url-without-id/174258
**Category:** Support
**Created:** [12월 25, 2020, 4:19오후 UTC](https://meta.discourse.org/t/using-slug-only-as-url-without-id/174258 "2020-12-25T16:19:41Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![caiiiycuk](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/caiiiycuk/32/201937_2.png) [@caiiiycuk](https://meta.discourse.org/u/caiiiycuk)
#### Post date: [12월 25, 2020, 4:19오후 UTC](https://meta.discourse.org/t/using-slug-only-as-url-without-id/174258/1 "2020-12-25T16:19:41Z")

</div>

안녕하세요. 저는 슬러그(slug)만 포함된 URL을 사용하는데, 예를 들면 다음과 같습니다:  
[https://talks.dos.zone/t/007-james-bond-the-stealth-affair-1990-fr/](https://talks.dos.zone/t/007-james-bond-the-stealth-affair-1990-fr/)  
하지만 이 URL을 브라우저에서 직접 열면 환영(Welcome) 주제로 리다이렉트됩니다. 다른 주제에서 동일한 URL을 클릭하면 정상적으로 작동합니다.  
예시 (프랑스어 링크 클릭):  
[https://talks.dos.zone/t/007-james-bond-the-stealth-affair-browser-and-mobile-versions/44659](https://talks.dos.zone/t/007-james-bond-the-stealth-affair-browser-and-mobile-versions/44659)

이것은 의도된 동작인가요?

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [12월 25, 2020, 6:01오후 UTC](https://meta.discourse.org/t/using-slug-only-as-url-without-id/174258/3 "2020-12-25T18:01:03Z")

</div>

이것은 의도된 동작입니다.

Discourse는 다음 3가지 유형을 지원합니다:

- 전체: [https://meta.discourse.org/t/using-slug-only-as-url-without-id/174258](https://meta.discourse.org/t/using-slug-only-as-url-without-id/174258)
- ID만: [https://meta.discourse.org/t/174258](https://meta.discourse.org/t/174258)
- 슬러그만: [https://meta.discourse.org/t/using-slug-only-as-url-without-id](https://meta.discourse.org/t/using-slug-only-as-url-without-id)

그러나 슬러그가 숫자로 시작하는 경우, 특수 처리하여 첫 번째 숫자를 ID로 검색합니다:

> <https://github.com/discourse/discourse/blob/main/app/controllers/topics_controller.rb#L65-L70>

---

<div class="post-metadata">

### Author: ![caiiiycuk](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/caiiiycuk/32/201937_2.png) [@caiiiycuk](https://meta.discourse.org/u/caiiiycuk)
#### Post date: [12월 25, 2020, 6:41오후 UTC](https://meta.discourse.org/t/using-slug-only-as-url-without-id/174258/4 "2020-12-25T18:41:59Z")

</div>

아, 그렇군요. 그러면 URL 수에 미치는 영향은 크지 않겠네요. 감사합니다!

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [12월 25, 2020, 9:14오후 UTC](https://meta.discourse.org/t/using-slug-only-as-url-without-id/174258/5 "2020-12-25T21:14:29Z")

</div>

> [@caiiiycuk](#):
>
> . 저는 슬러그만 있는 URL을 사용합니다.

브라우저에서 (ID가 포함된) URL을 사용하는 것보다 더 많은 작업이 필요하며, 주제를 이름 변경하면 작동하지 않게 됩니다. (또한 제목이 숫자로 시작하는 경우에도)
