How to redirect a category using permalink rules


(Erlend Sogge Heggen) #1

: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

  2. Change the middle drop-down to Category ID

  3. 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.

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


How to redirect from permalinks?
(Jeff Atwood) #2

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


(Erlend Sogge Heggen) #3

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.