Choose URL structure in admin/site_settings

AI-generated summary

The discussion revolves around implementing customizable URL structures for topics in the admin/site_settings, particularly for multilingual communities. Users debate the feasibility and desirability of allowing different slug formats, including Unicode URLs (as used by zh.wikipedia.org since 2002) and options like ‘Same as title’ or ‘English-only’ slugs. fantasticfears proposes adding site settings for slug customization, citing interest from Chinese and Korean communities. winterbox supports this, suggesting options like 분러여-다니습갑반, 분러여-다니습갑반, or emosewa-si-esruocsid/ to accommodate mixed CJK and English content. ben_lubar highlights that while older browsers may not support Unicode URLs, modern ones do, and such URLs can be effective for SEO. codinghorror expresses skepticism, questioning the practicality of the request. The consensus leans toward offering configurable slug options, with the current behavior of sanitizing non-English characters being noted as a baseline.

Continuing the discussion from Disabling English slugfier for topic’s URL in Korean language setting:

Everyone has their own preference on URL structures:

  • /topic/###
  • /discourse-is-awesome
  • /반갑습니다-여러분
  • /您好
  • or possibly transliteration

Some might prefer just English letters & numbers combination even they use their own languages.

If Discourse allows admins can choose the URL structure, it would be very useful.
Like Wordpress’ ‘Permalink Settings’: Customize permalinks – Documentation – WordPress.org
http://codex.wordpress.org/images/a/ad/permalink-settings.png

To me, /t/topic/### is just OK, but maybe there are people who want to use other structure types in my country. Also, giving options seems better, so I create this topic.

@fantasticfears would you add details or feedback?

2 curtidas

(PS: This quote is broken…)

Thanks to some heavy route logic, it’s not that easy and necessary to implement custom url structure.

I would insist on /t/:topic_slug/:topic_id URL structure. There are some custom options applies to :topic_slug, which convert as:

  • default: anything to topic
  • english: Discourse 测试 to discourse(current behaviour)
  • same as title: 반갑습니다-여러분 to 반갑습니다-여러분

Does that make sense to you?

I think I misunderstood your idea…Did you want to customize all topic’s slug? I don’t like this idea since it confuses people when they saw it.

Does ‘same as title’ mean: 안녕하세요-discourse to 안녕하세요-discourse? (English + Non-English to English + Non-English)

What do you mean? Choose slug type whenever they create topics???

Yes. Only sanitized some symbol cannot be used as URL.

And ‘English’ means : cutting out non-English letters. Right? Then I love your options.

But I don’t understand what you mean here:

It’s the current behaviour. When you mix CJK characters, english letters and numbers, the Discourse strips CJK characters.

I mean did you want some mechanism to set the topic’s url like category slug you proposaled days ago?

Yes. Including the current behavior, I love your options(Default, English, Same as title) for :topic_slug.

No. I don’t want to customize all the URLs topic by topic. (I don’t like it either.)

What I want is:

  1. Admin choose URL structure for topic in site setting.
  2. Then all the new topics start to be generated with the URL logic Admin chose.

Is it clear now? :wink:

1 curtida

I don’t think this request makes sense.. what is really being asked for is control over whether the slug is ASCII or not, or even a custom slug.