Support » Fixing WordPress » 301 Redirects for Changed Permalink Structure

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

  • The topic ‘301 Redirects for Changed Permalink Structure’ is closed to new replies.