Forums

Redirecting re-slugged categories (3 posts)

  1. Jayvie Canono
    Member
    Posted 7 years ago #

    I have started renaming and reslugging my categories, and downright deleting some of them. I do want the former links to redirect to their relevant targets, with the links to deleted categories redirecting to my root. I got the deleted category to redirect to the root but I can't seem to get a renamed cat to lead to its new slug name. For example:

    I had a category slugged as brave-new-world and I want it to redirect to the new name/slug of the category, science so I put this in my htaccess:

    Redirect 301 /category/brave-new-world/ http://onefinejay.com/category/science/

    However in the Address bar of my browser it does this instead: http://onefinejay.com/category/science/?category_name=brave-new-world/ and it shows me the standard No Posts message. Am I doing something wrong with my htaccess redirect code or is am I encountering an incompatibility with WordPress' own htaccess?

  2. Mark Jaquith
    WordPress Lead Dev
    Posted 7 years ago #

    you should add the [L] switch to the end, and also make sure that this redirect is BEFORE your WordPress rewrite rules in .htaccess

  3. Mark Jaquith
    WordPress Lead Dev
    Posted 7 years ago #

    Actually, forget the [L] part... thats for RewriteRule. Just make sure the redirect is before the WP rules.

Topic Closed

This topic has been closed to new replies.

About this Topic