301 Redirects are very important, especially if you’re moving your site from one domain to another.
You can redirect any URL to another one using a couple of different?kinds of redirects. For example if you type in petersaydak.net it redirects to?petersaydak.com because that’s my main website.
A 301 redirect means that the page you’re being redirected has moved permanently (the 301 refers to the HTTP code for the type of redirect).
For example my origami website used to be called OrigamiUniversity.com and now it’s called Origami.me.
When I redid the site and switched it over to the new URL I had to 301 redirect all the pages on the old site to the same page on the new site.
OrigamiUniversity.com/origami-diagrams for example was 301 redirected to Origami.me/origami-diagrams.
There are a couple of reasons why it’s very important to use 301 redirects when you’re making a new website.
1) So People Can Find Your New Site
If you make a new site and simply remove the old one no one will be able to find your new site.
If someone has a page on your site bookmarked and tries to visit it they’ll just get a page not found message. They’ll get the same error if they type your website address directly into their browser or click on your site on a search result on Google.
If you 301 redirect all the pages on your old site then if someone clicks on the old page they’ve bookmarked it’ll automatically take them to the new page on the new website.
It’s the same thing if they type the URL into their browser or click on a search result. They’ll automatically be taken to the new page on the new site and think, “wow, they made a new website, it looks great”.
They probably won’t even realize that the URL changed but that’s ok because they’re still using your website.
2) So Search Engines Can Figure Out What’s Going On
When you 301 redirect a page from an old URL to a new one you’re telling search engines that they shouldn’t show the old page and instead should show the new page.
Search engines will realize that the page has changed location and there’s a new URL for the page that they should show in their search results instead.
More importantly,?90% to 99% of the “link juice” or search rankings that the old page has built up will flow to the new page.
A huge amount of your search engine rankings come from getting links to your site. If you get a ton of good quality links to a page on your site and that site ranks number 1 on Google for a particular keyword but then move the page to a new URL you have to start over. Your new page will rank at the bottom of Google until you’re able to build up links to the new page.
Using a 301 redirect though you can still get almost all the ranking power that you were getting from the old page. Even though other sites are linking to the old URL that URL links to the new one and the ranking power of your old page flows to your new one.
It does take a while for search engines to figure out what’s going on but after a little while the new page should start showing up in the number 1 position like your old page was.
For example, I have a very popular page on my origami website about Pokemon origami.
On the old version of the site the URL was OrigamiUniversity.com/pokemon-origami and on the new site the URL is Origami.me/pokemon-origami.
The page was ranking #1 for the term “Pokemon origami”. When I switched to Origami.me I 301 redirected this URL and the new page Origami.me/pokemon-origami now ranks #1 for that term on Google.
All the links to the old URL are passing on the ranking power to the new page through the 301 redirect.
When Else Should You Use 301 Redirects?
We’ve already discussed that you need to use 301 redirects in the event that you move your website from one URL to another. There’s another case where you should also use 301 redirects.
If you ever delete a page from your website make sure to 301 redirect the old URL to a new one. If you have an old page about a certain topic and you make a new and better page, make sure to redirect the old one to the new one.
Never just outright delete a page from your website. If someone’s ever linked to it or bookmarked it and they try to access it they’ll get a 404 Page not Found error.
Even if you delete a page and you don’t have any new or better versions of it at least 301 redirect that URL to your homepage.?Anyone who tries to visit the old deleted page will land on your homepage which is better than a 404 page.
You can also always make a page with a quick message saying why the page was deleted with some links to something else they might be interested in.
How to Make 301 Redirects on Your Website The Easy Way
If you’re using WordPress for your website then you have a couple of quite easy options for making 301 redirects.
Probably the easiest way is to use a free plugin called Simple 301 Redirects. There’s a ton of plugins that can do this but this one is my favourite and I think it’s the easiest to use.
In your WordPress dashboard navigate to Plugins > Add New and search for “Simple 301 Redirects”.
Click the Install Now button and then activate the plugin.
There’s now a 301 redirect option added to your WordPress dashboard, it’s under Settings > 301 Redirects
This plugin is very easy to use. To create a redirect enter the last part of the URL after the root domain of your WordPress website.
For example if you have www.yoursite.com/old-page all you need to enter in the field on the left is “/old-page”.
In the field on the right for the destination you have to enter the full URL for the new page, even if it’s on the same domain. You have to enter the http as well so in this field you’ll enter something like “http://www.yoursite.com/new-page”.
Then hit save changes and your redirect will be saved.
Next do a quick check, type the old URL in your browser and you’ll see that it redirects to the new page.
If you’re moving the site to a new URL one of the easiest things to do is just keep a basic WordPress installation up on the old URL with this plugin installed. Then enter all the URLs for all the old pages and redirect them to the URLs on the new site.
This is probably the easiest option if you’re not very technical.
The Use Wildcards check box lets you use an * symbol to redirect a bunch of things at once.
For example if you have a section of your website with URLs like yoursite.com/topic/post1, yoursite.com/topic/post2, yoursite.com/topic/post3, etc. and you want to redirect all those to one page on the new site you can.
In the Request field simply put “/topic/*” and in the Destination field put the full URL of the page you’re redirecting everything to.
You can also redirect multiple pages like this to multiple pages on the new website.
If you have pages like oldsite.com/topic/post1, oldsite.com/topic/post2 and you want to redirect them to newsite.com/topic/post1, newsite.com/topic/post2 then you can do that too.
In the Request field put “/topic/*” and in the Destination field put “http://newsite.com/topic/*” and as long as the URLs for the pages match they’ll redirect.
Using wildcards might seem a bit overwhelming and I personally prefer to redirect each page one at a time just so I can be sure I set everything up correctly.
However if you’re redirecting a huge number of URLs from an old site to a new one and not really making any changes to the URL structure then the wildcards can save you a bit of time.
Making 301 Redirects Using the Genesis Framework
I very much recommend using the Genesis Framework as the theme for your website for a number of reasons. I cover the Genesis Framework in a post called:
How to Set Up the Best WordPress Theme for Your New Website
The Genesis Framework adds a little SEO section to the bottom of every page with some handy options including a 301 redirect field.
In the editor on any post or page scroll down until you see the Theme SEO Settings.
Near the bottom of these settings is a field called Custom Redirect URL. To redirect the page you’re editing simply paste the full URL (including the http://) into this field and any time you visit this page on your website it’ll automatically redirect to the new URL.
Using the Genesis Framework is another great option if you don’t want to bother installing extra plugins.
If you’re only ever redirecting a page or two and not often then this is probably the easiest way to do it if you’re already using the Genesis Framework.
Making 301 Redirects Using Your .htaccess File?(The Hardcore Way)
If you want to make 301 redirects the official way by writing code then you can do that by editing a file on your website called .htaccess.
The .htaccess file is a configuration file used by web servers that are running the Apache Web Server software.
You’ve probably never heard of this file and it’s not easy to access. It stores various configuration options, one of them being 301 redirects.
The .htaccess file is saved in your root directory on your website. You can access it using an FTP client although the file is usually hidden so make sure you turn on the option to view hidden files.
You can then download the file and edit it in a program like Dreamweaver or just Notepad.
The plugin Yoast SEO also lets you edit your .htaccess file much easier. I highly recommend the Yoast SEO plugin and I cover how to set it up here:
The Ultimate Guide to Search Engine Optimizing Your WordPress Site
In your WordPress Dashboard go to SEO > Tools and click on File editor.
This will open an editor for both your robots.txt file and .htaccess file.
There’s already some code from WordPress in your .htaccess file so don’t delete that or you could break something. If you see something extra here then it’s probably from one of your plugins.
To add in your 301 redirects you can start typing the code in an empty line after what’s already here.
The code to make a 301 redirect is actually pretty simple and looks like this:
Redirect 301 /old-page/ http://www.newwebsite.com/new-page/
That’s it, just type “Redirect 301” followed by a space and then the name of the old page followed by another space and then the full URL for the new page.
It works just like the Simple 301 Redirects plugin from earlier.
You can add a ton of 301 redirects, one per line like this:
Redirect 301 /old-page/ http://www.newwebsite.com/new-page/ Redirect 301 /a-page/ http://www.newwebsite.com/a-new-page/ Redirect 301 /some-page/ http://www.newwebsite.com/some-new-page/
People also usually add comments to make the file a bit more organized. If you type a # first then the line is a comment that explains what’s going on in the code.
You’ll see in my .htaccess file above I have the “# BEGIN WordPress” and “# END WordPress”. That’s to show that the code in-between those two comments was added by WordPress.
When people do 301 redirects using the .htaccess file they usually add “# BEGIN 301 Redirects” and “# END 301 Redirects” to keep everything organized.
It’ll just look like this:
# BEGIN 301 Redirects Redirect 301 /old-page/ http://www.newwebsite.com/new-page/ Redirect 301 /a-page/ http://www.newwebsite.com/a-new-page/ Redirect 301 /some-page/ http://www.newwebsite.com/some-new-page/ # END 301 Redirects
There’s also a very useful piece of code you can use if you moved your site from one domain to another and kept all the page URLs the same.
This will redirect every page from your old website to the same page on the new website:
<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTP_HOST} ^oldsite\.com$ [OR] RewriteCond %{HTTP_HOST} ^www\.oldsite\.com$ RewriteRule (.*)$ http://newsite.com/$1 [R=301,L] </IfModule>
Just edit this code to change “oldsite” and “newsite” to whatever your new names are. Also change all the .coms to .nets or whatever if you’re not using a .com.
This code needs to replace what ever is already there between the “# BEGIN WordPress” and “# END WordPress” lines.
If you’re completely redirecting everything from the old site to the new one then the only code you need in your .htaccess file is:
#BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTP_HOST} ^oldsite\.com$ [OR] RewriteCond %{HTTP_HOST} ^www\.oldsite\.com$ RewriteRule (.*)$ http://newsite.com/$1 [R=301,L] </IfModule> #END WordPress
This code will redirect both the www and non-www versions of your old URLs to the new ones.
Updating the Google Search Console
If you’re moving your site from one domain to another then Google will eventually figure out what’s going on?but if you want to help speed it up then you can let them know about your redirects in the Google Search Console.
Make sure both the old website and the new website are added and verified in your Google Search Console account.
Then click onto your old website and under the drop-down settings menu with the gear select Change of Address.
Next you’ll see this screen with 4 steps to follow:
It might take a little while for your 301 redirects to take effect so you might not be able to complete these steps for a little bit. If that’s the case just try again in a day or so and you should be good.
Do You Have to Leave Your 301 Redirects Up Forever?
Most SEO experts suggest you leave your 301 redirects up for at least 6 months to a year. Google themselves recommends you keep them up for at least a year because it can apparently take Google that long to realize that a site has fully moved from one domain to another.
I personally have moved two websites from one domain to another and I still have the 301 redirects set up several years after the site has moved.
I’m sure everything’s good as far as search engines are concerned but I like keeping them there just to be safe and just incase someone still has the old domain bookmarked or something.
Keeping the old domain registered usually only costs $10 to $15 and pretty much any web host will let you host more than one website for free so there’s pretty much no reason to not leave your 301 redirects up. I think at least.
302 Redirects
You also might hear about 302 redirects. These work just like 301 redirects except they’re temporary.
If you’re doing maintenance on your website for example and you want to redirect people to a different URL for a little bit until you’re done then you use a 302 redirect.
In your case though you’ll probably never need to use these.
In Conclusion
You can now see why 301 redirects are very important for both your site vistors and search engines.
If you move your website from one domain to another and don’t set up 301 redirects you’re probably going to lose all your traffic for a pretty long time until your new site starts climbing up the search engine ranks.
Plus if you’ve done any SEO work on the old site you’re going to lose all of it unless you 301 redirect everything to the new site.
If you have any questions about 301 redirects feel free to ask in the comments and I’ll close out this post with a quick video about how to properly use 301 redirects from Google themselves.
This post appeared on the Realty Digital Marketing Professional Community here:?What are 301 Redirects and Why are They Important for SEO?