WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How to Redirect old links after change of Permalinks? (3 posts)

  1. Jaya
    Member
    Posted 1 year ago #

    Hello,

    in short: I had the following structure:
    /%year%/%monthnum%/%day%/%post_id%

    and I changed it to:
    /%post_id%

    I'd like visitors to the old URL (from a search engine for example) to be redirected to the new one.

    i found a solution to Redirect Day and name permalinks to /%postname%/
    but I have no idea how to change it to work in my case.

    RedirectMatch 301 /([0-9]+)/([0-9]+)/([0-9]+)/(.*)$ http://www.domain.com/$4

    Appreciate your help!

  2. RedirectMatch 301 /([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*)$ http://www.domain.com/$4

    That says to look for ####/##/##/anything, which is a little better.

    Though WP should redirect for you.

  3. Jaya
    Member
    Posted 1 year ago #

    Thank you so much! That worked :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags