WordPress.org

Ready to get started?Download WordPress

Forums

301 Redirects for Changed Permalink Structure (1 post)

  1. doodlz
    Member
    Posted 2 years ago #

    I apologize for the following question. I've searched through forum posts and articles and have not found a definitive answer.

    I'm redesigning a site on a fresh WP install. The old site had a custom Category base and the following permalink structure:

    http://domain.com/CATEGORY/POSTNAME/

    The new site has the default Category base and the following permalink structure:

    http://domain.com/YEAR/MONTH/POSTNAME/

    I need to set up a 301 redirect in htaccess that correctly redirects the old posts. I understand the following rule will redirect the category base:

    RewriteRule ^oldcategorybase/(.*)$ http://domain.com/category/$1 [L,R=301]

    But what about the posts? Does anyone have the correct rewrite rule?

    Note: I don't want to use a plugin. I prefer coding it myself. It appears that all the redirection plugins don't work.

Topic Closed

This topic has been closed to new replies.

About this Topic