WordPress 301 Redirects for thousands of posts

I have a site with more than 2000 links beeing redirected in my .htaccess file.

I would like to restructure my htaccess, so the 301 redirections work faster, and also do not loose any SEO.

Read More

Let’s say I have 2 categories in my blog.
mysite.com/blog/old_planes
mysite.com/blog/old_cars

that I want to redirect to
mysite.com/blog/new_planes
mysite.com/blog/new_cars

For each category I have a number of posts. How should I redirect them? I mean should I redirect each post and after that the category?
Redirect 301 /blog/old_planes/747 http://www.mysite.com/blog/new_planes/747
Redirect 301 /blog/old_planes http://www.mysite.com/blog/new_planes
or first redirect the category and then the posts? I want them all to work. Most important I do not want any “NOT FOUNDS” in webmaster tools.

Does the order matter?
If I want latter to add a new redirect should I search the specific category and paste it there? Or should I paste it at the end of my 2000 redirects.

Related posts

Leave a Reply

2 comments

  1. Simply doing:

    Redirect 301 /blog/old_cars /blog/new_cars
    Redirect 301 /blog/old_planes /blog/new_planes
    

    Is all that you need. Anything after the old_cars/ and old_plans/ will automatically show up in the new destination. However, since this is wordpress, you’ve probably got some mod_rewrite rules in your htaccess file, and these redirects will interfere with how that works. So instead, you should use mod_rewrite and add these rules before your wordpress rules:

    RewriteRule ^blog/old_cars(.*)$ /blog/new_cars$1 [L,R=301]
    RewriteRule ^blog/old_planes(.*)$ /blog/new_planes$1 [L,R=301]