(Superseded) Redirect a category using permalink rules

:warning: Please Note

Discourse now automatically redirects renamed categories. I will leave this HowTo up for the time being to cover any eventual edge cases that the automatic redirect doesn’t take into account.

Say you’ve renamed the category /c/school to /c/education and you’d like to make sure all old links that point to https://forum.example.com/c/school will now redirect to https://forum.example.com/c/education. Here’s what you do.

  1. Go to /admin/customize/permalinks:

Here you should enter the partial URL of the category slug that you’re redirecting, in this case c/school

  1. Change the middle drop-down to Category ID

  2. Now, in a separate window, go to your renamed /c/education category and append .json to its URL, so that it looks like this: https://forum.example.com/c/education.json. On this page, search for “category_id”. You’re gonna want to copy & paste this number into your “Category ID” field.

  3. Lastly, enter the ID - in this case 10 - of the category. Before clicking “Add” your form should look like this:

12 Likes

Isn’t this process automatic on renaming a category after @techapj’s recent change?

5 Likes

I see! The change must not have been deployed yet to Try when I tested it. I tried again today and it does indeed happen automatically, thanks @techAPJ :heart:

I’ve updated the howto accordingly.

6 Likes

For anyone looking for a way to do this, check this: