It comes a day when you start making changes to your website. These changes can be from a simple change in design to completely change the CMS that powers the site. Or maybe you are moving your site from an old domain to a new one. In this case, you want to make sure that the links you have worked hard to rank in Google don’t just disappear. You want to redirect them to the new ones. How? By using 301 redirect, of course!
There are three types of redirects. We want to make sure to use the right one, 301 redirect, which tells Google that this link has moved permanently. The other two types are 302 (found or moved temporarily) and Meta Refresh. More about redirection you can read at this awesome guide by Moz.
In this article, I’m going to write about two ways to mass 301 redirect links by using .htaccess and WordPress (because it’s too damn popular to ignore it).
Mass 301 redirect using .htaccess
Mass redirection in .htaccess it’s pretty easy, actually. All you need to do is open your .htaccess file in the root of your site and add these lines of code:
Redirect 301 /old-page.html http://www.example.com/new-page.html
Redirect 301 /old-page-2.html http://www.example.com/file/
You can also 301 redirect an entire site with just one line of code:
Redirect 301 / http://www.new-site.com/
Mass 301 redirect using WordPress plugin
WordPress 301 Redirects is this awesome plugin that I use whenever I need to redirect links from my WordPress sites. After installing the plugin, all you have to do is start adding links you want to redirect from your site.
Whenever you change something in your link structure, it’s imperative to be careful of what will happen with the old links. You don’t want to see all SEO traffic going to 404 error pages (which eventually will follow with a drop in rankings). It’s also a bad experience for the visitors. So whenever you make these changes, you have to be sure that the old links are pointing to the new ones.
Don’t forget to share this post!