WordPress.org

Forums

How can I add 301 redirects to change my permalinks? (7 posts)

  1. Norbert McDorbert
    Member
    Posted 2 years ago #

    Hello

    I need to create an htaccess rule to redirect my old posts to the new structure to avoid broken links

    currently its

    /post_id/postname

    want to change to

    /catname/postname

    Normally a regex would work for a this to that, but as its a dynamic number, I cant figure out how to do it. Any advice?

  2. ken1990julius
    Member
    Posted 2 years ago #

    you can check rewrite API in the documentation(codex) for this.

  3. Norbert McDorbert
    Member
    Posted 2 years ago #

    I am not asking how to Change permalinks.

    Asking how to create a rule in htaccess to redirect broken permalinks.

  4. Prasanna SP
    Member
    Posted 2 years ago #

    Try Advanced Permalinks plugin - http://wordpress.org/extend/plugins/advanced-permalinks/

    It's features list has,

    301 redirect old permalink structures (many structures are allowed)

  5. Norbert McDorbert
    Member
    Posted 2 years ago #

    thanks all.

    i saw yoast wrote a plugin for it, but that is for

    X+Y to go to /posttitle/

    Was hoping someone was good with regex, so I could do an HTACCESS mod.

    http://yoast.com/change-wordpress-permalink-structure/
    (scroll down)

  6. Andrew Bartel
    Member
    Posted 2 years ago #

    Why not give it a shot yourself Norbert and see if it works? If you're unable to find a solution, you could post in a dedicated htaccess forum?

  7. Norbert McDorbert
    Member
    Posted 2 years ago #

    Hey Andrew.

    The code yoast provides is good, however, I just cant grasp how to redirect to categories

    I didnt even know about the Htaccess cat. Man this place is huge ;)

Topic Closed

This topic has been closed to new replies.

About this Topic