# Slug is required in topic URL?

**URL:** https://meta.discourse.org/t/slug-is-required-in-topic-url/45207
**Category:** Feature
**Created:** [June 3, 2016, 3:47pm UTC](https://meta.discourse.org/t/slug-is-required-in-topic-url/45207 "2016-06-03T15:47:24Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![jhands](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jhands/32/121736_2.png) [@jhands](https://meta.discourse.org/u/jhands)
#### Post date: [June 3, 2016, 3:47pm UTC](https://meta.discourse.org/t/slug-is-required-in-topic-url/45207/1 "2016-06-03T15:47:25Z")

</div>

I went to link a topic from another topic and noticed that `[link](/t/45202)` [produces the error](https://meta.discourse.org/t/45202)  
`Access Denied while trying to load /t/id_for/14`

However `[link](/t/blah/45202)` [works fine](https://meta.discourse.org/t/blah/45202). I believe this is a bug.

---

<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: [June 3, 2016, 3:50pm UTC](https://meta.discourse.org/t/slug-is-required-in-topic-url/45207/2 "2016-06-03T15:50:24Z")

</div>

> [@jhands](#):
>
> However [link](https://meta.discourse.org/t/blah/45202) works fine. I believe this is a bug.

actually this is intended behavior. you have to have something in the `blah` spot in the URL. You can put whatever you want in there.

---

<div class="post-metadata">

### Author: ![jhands](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jhands/32/121736_2.png) [@jhands](https://meta.discourse.org/u/jhands)
#### Post date: [June 3, 2016, 4:17pm UTC](https://meta.discourse.org/t/slug-is-required-in-topic-url/45207/3 "2016-06-03T16:17:05Z")

</div>

But why don’t you have to put something in blah when linking the full address? [https://meta.discourse.org/t/45202](https://meta.discourse.org/t/45202) when you link on anything other than discourse. (Put that up in the address field of browser and it will work.)

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [June 3, 2016, 4:28pm UTC](https://meta.discourse.org/t/slug-is-required-in-topic-url/45207/4 "2016-06-03T16:28:39Z")

</div>

I see what you are saying now. It also works if you open in new tab vs click directly.

---

<div class="post-metadata">

### Author: ![jhands](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jhands/32/121736_2.png) [@jhands](https://meta.discourse.org/u/jhands)
#### Post date: [June 3, 2016, 4:33pm UTC](https://meta.discourse.org/t/slug-is-required-in-topic-url/45207/5 "2016-06-03T16:33:17Z")

</div>

Yes exactly. It can’t exactly be removed now since it’d break a lot of links to discourse sites. So I think it should be fixed to allow t/1234 within the same Discourse site for consistency.

---

<div class="post-metadata">

### Author: ![johnmuhl](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/johnmuhl/32/43413_2.png) [@johnmuhl](https://meta.discourse.org/u/johnmuhl)
#### Post date: [June 3, 2016, 4:45pm UTC](https://meta.discourse.org/t/slug-is-required-in-topic-url/45207/6 "2016-06-03T16:45:34Z")

</div>

Seems similar to:

> [@Title links only work if the slug is present](https://meta.discourse.org/t/title-links-only-work-if-the-slug-is-present/32165):
>
> Links like this [https://meta.discourse.org/t/site-being-phished-on-third-party-domain/32112](https://meta.discourse.org/t/site-being-phished-on-third-party-domain/32112) work but when you only use the /t/:id part like this [https://meta.discourse.org/t/32112](https://meta.discourse.org/t/32112) you get an error instead. Reloading the error page causes the correct page to load.

---

<div class="post-metadata">

### Author: ![jhands](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jhands/32/121736_2.png) [@jhands](https://meta.discourse.org/u/jhands)
#### Post date: [June 3, 2016, 6:23pm UTC](https://meta.discourse.org/t/slug-is-required-in-topic-url/45207/7 "2016-06-03T18:23:52Z")

</div>

Yeah that’s the same issue (I couldn’t find that when searching.)  
@codinghorror says there that a slug of at least 1 character is required. If that’s the case, how did it end up that slugs aren’t required for fully qualified links?

---

<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: [June 3, 2016, 6:29pm UTC](https://meta.discourse.org/t/slug-is-required-in-topic-url/45207/8 "2016-06-03T18:29:17Z")

</div>

> [@jhands](#):
>
> If that’s the case, how did it end up that slugs aren’t required for fully qualified links?

that’s a good point and I wasn’t aware of it. I don’t think this used to work and I’m not sure why it does.

nice URL hacking! 😉
