Old topics redirect



  • Currently when you rename a topic, it changes the url and deletes the old url. I think that a nice plugin/feature would be if the old url redirected to the new one.

    Thanks
    ~EpicDinosaurz


  • Community Rep

    Let's say you have a topic
    http://example.com/topic/23/my-theme

    you renamed it to something like
    http://example.com/topic/23/my-super-mega-theme

    anyway it's still can be reached by following urls
    http://example.com/topic/23
    and
    http://example.com/topic/23/
    theoretically you can make a rewrite rule with regex in your server definition (if you're using nginx as reverse-proxy) for redirect all urls like /* by default min topic name length = 3 */
    http://example.com/topic/ATLEAST_ONE_DIGIT/ATLEAST_THREE_NONESLASH_CHAR
    to
    http://example.com/topic/FIRST_MATCH/

    but there is a major caveat
    urls like
    http://example.com/topic/23/my-super-mega-theme/17
    will not work

    BUT actually you still may reach this address
    http://example.com/topic/23/my-super-mega-theme/17
    by using hash part of url
    http://example.com/topic/23/#17

    so, you able to make a rewrite rule that contains this case too
    it will looks like
    http://example.com/topic/ATLEAST_ONE_DIGIT/ATLEAST_THREE_NONESLASH_CHAR/ATLEAST_ONE_DIGIT
    to
    http://example.com/topic/FIRST_MATCH/#THIRD_MATCH

    It all should work but I didn't tested it.


  • Global Moderator

    @Epic_Dinosaurz said:

    Currently when you rename a topic, it changes the url and deletes the old url. I think that a nice plugin/feature would be if the old url redirected to the new one.

    Thanks
    ~EpicDinosaurz

    It used to. But it meant that something else didn't work. So was removed. Baris made a post about it in a similar topic a few months ago.


Log in to reply
 


Looks like your connection to NodeBB was lost, please wait while we try to reconnect.