Tricky question regarding Discourse permalinks

I have a list of external URLs that I want to forward to my community. The list will be umpteen and ever-growing, but a small subset is, say:

  • security/advisories/ADV-2024-003
  • security/advisories/ADV-2022-002
  • security/advisories/ADV-2025-005

How can I create permalinks that can account for any case? e.g. if they navigate to security/advisories/adv-2025-005, it would still take them to that topic?

2 Likes

I could not find any decent tricks, but there is a possible way to use the Permalink normalizations setting.

You could do, for example:

/security\/advisories\/[aA][dD][vV]-(\d+-\d+)/s-adv-\1

It transforms
security/advisories/ADV-2024-003
security/advisories/adv-2024-003
security/advisories/aDv-2024-003

s-adv-2024-003

Then, you create a redirect with it:

image

Would it work for you?

1 Like

I would still want the permalink to ultimately be: security/advisories/{advisory, I wouldn’t want it to be shorter.

1 Like

If you prefer, you can write the following, it gives the same result.

You can use:
/security\/advisories\/[aA][dD][vV]-(\d+-\d+)/security/advisories/adv-\1

Then:

7 Likes

This worked perfectly, so long as my permalinks start out lowercase like this. Thank you!

4 Likes