Route alias for a topic via theme component?

I’d like to add a route alias for a specific topic in Discourse. In my example, I’d like to have “/events” be an alias for “/t/events/42”. Is it possible to do this purely client side without having to define a backend route via a plugin? I tried adding a route and transitionTo via theme component, but this only works when the UI has successfully loaded a page and the user clicks a link to navigate to “/events”. If the user tries to load the “/events” link directly, they get a Oops! That page doesn’t exist or is private. error.

I’m guessing this is because Discourse does not do “html5 style routing” where unknown routes on the server side serve a SPA which does client side routing. Is there a way to set Discourse to fall back to client side routing if the server side route isn’t found? If not, it seems like any/all route aliases would have to be defined via a plugin registering them as valid backend routes that redirect.

See /admin/customize/permalinks It’ll redirect, to the topic. I think that’s what you want.

1 Like

Ah-ha! Yes, that’s exactly what I wanted and didn’t realize it was already built in. Thanks!

1 Like