# Removing the concept of "slugs" for some languages

**URL:** https://meta.discourse.org/t/removing-the-concept-of-slugs-for-some-languages/26643
**Category:** Feature
**Created:** [23 maart 2015 om 00:36 UTC](https://meta.discourse.org/t/removing-the-concept-of-slugs-for-some-languages/26643 "2015-03-23T00:36:35Z")
**Posts on this page:** 8
**Page:** 2

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [18 augustus 2017 om 20:00 UTC](https://meta.discourse.org/t/removing-the-concept-of-slugs-for-some-languages/26643/23 "2017-08-18T20:00:13Z")

</div>



---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [18 augustus 2017 om 20:07 UTC](https://meta.discourse.org/t/removing-the-concept-of-slugs-for-some-languages/26643/24 "2017-08-18T20:07:02Z")

</div>

@fantasticfears I am reopening this cause this needs urgent polish (in fact make this your #1 priority)

Issues I have:

- If a topic has the `test งಠಠง` and slug generation method is “encoded” the slug is `test-งಠಠง`. This is a nasty problem cause the actual UI will cause a fight with the browser. The browser sends over the slug as `test-%E0%B8%87%E0%B2%A0%E0%B2%A0%E0%B8%87` and we perform no decoding on our side which leads to an infinite redirect in the topic page, if you hit reload. It feels to me like “encoded” should be always percent encoded.

- If you change slug generation method there is no way of “fixing” the slug cache in “topics” table. There needs to be some mechanism of clearing out the “slug” column on topics. Maybe if you touch that setting it should automatically null out all cached slugs on topic.

As it stands we are seeing some extreme issues here with infinite redirects and there is not clean way of correcting the customer issues.

---

<div class="post-metadata">

### Author: ![fantasticfears](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fantasticfears/32/119608_2.png) [@fantasticfears](https://meta.discourse.org/u/fantasticfears)
#### Post date: [21 augustus 2017 om 09:11 UTC](https://meta.discourse.org/t/removing-the-concept-of-slugs-for-some-languages/26643/25 "2017-08-21T09:11:30Z")

</div>

OK, I’ve researched into Rails router, Rack and Webrick. According to previous dev discussion, I am sure Rails conforms to Rack behaviour. This might not be ideal for us. Though I didn’t check, I have some confidence to say that Puma and Unicorn don’t escape non-ascii for URI. In contrast, Webrick does conforms to this point but it pins the uri into `US_ASCII`. It would be a complicated debug process to hunt down the cause. It might be regexp failure, encoding problem for Rails router GTG.

My step would be:

1. Escape our Slug detector fast to fix urgent problem.
2. Find a place to report this problem or write PR. I am not familiar with Rails community. I would like to ask for your direction later.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [21 augustus 2017 om 12:34 UTC](https://meta.discourse.org/t/removing-the-concept-of-slugs-for-some-languages/26643/26 "2017-08-21T12:34:44Z")

</div>

Sure, but we also need to make sure we deal with history AND switching slug generation mechanisms. Both are critical we deal with. When you switch mechanisms on categories it is particularly complicated cause we allow overrides.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [2 december 2017 om 10:02 UTC](https://meta.discourse.org/t/removing-the-concept-of-slugs-for-some-languages/26643/27 "2017-12-02T10:02:30Z")

</div>

I think this is all working properly now that we upgraded to rails 5 ? @tgxworld ?

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [11 december 2017 om 08:41 UTC](https://meta.discourse.org/t/removing-the-concept-of-slugs-for-some-languages/26643/29 "2017-12-11T08:41:20Z")

</div>

Yup, we just had to teach people how to “re-cook” all the slugs

> [@sam](#):
>
> If you change slug generation method there is no way of “fixing” the slug cache in “topics” table. There needs to be some mechanism of clearing out the “slug” column on topics. Maybe if you touch that setting it should automatically null out all cached slugs on topic.

I think only this is left. We had a number of support request coming in asking us how to “re-cook” the slug.

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [13 december 2017 om 08:12 UTC](https://meta.discourse.org/t/removing-the-concept-of-slugs-for-some-languages/26643/31 "2017-12-13T08:12:38Z")

</div>

Fixed in

[https://github.com/discourse/discourse/commit/d5293aeae258bd298a2d6d49134bca71cb00c6ed](https://github.com/discourse/discourse/commit/d5293aeae258bd298a2d6d49134bca71cb00c6ed)

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [28 december 2017 om 00:57 UTC](https://meta.discourse.org/t/removing-the-concept-of-slugs-for-some-languages/26643/32 "2017-12-28T00:57:26Z")

</div>



[Previous page](https://meta.discourse.org/t/removing-the-concept-of-slugs-for-some-languages/26643.md?page=1)
