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.
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.
For redirections, yes you can manually update your htaccess file, but I have been using a plugin that seems to fit the bill on a few sites – it makes tracking changes a lot easier in a convenient admin panel:
http://wordpress.org/plugins/redirection/
Simply doing:
Is all that you need. Anything after the
old_cars/
andold_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: