The internet is always changing. Sites like archive.org are specifically designed to keep track of those changes. In order to facilitate the organic nature of the net, HTTP status codes 301 and 302 were developed to make sure that if you changed sites or needed to adjust a URL, you didn’t need to worry about losing backlinks, breaking your own site’s structure, or even swapping entire sites from one place to another.
This article is aimed at the best practices for using a 301 or 302 redirect. We already have a full guide on how to go in and create the redirects that you should check out to dig into the finer details.
What is a 301 Redirect?
A 301 redirect is considered a permanent redirect. You are redirecting example.com/page-a to example.com/page-b and (generally) have no intention of using the first URL anymore.
This means that Google will essentially treat the new URL as the canonical one, and in doing so, will transfer all link juice and page rank from /page-a to /page-b. Formerly, Google would only pass partial page rank via 301. The search engine has since updated its algorithm and now passes along full link juice to the target URL. The old URL basically becomes the new one in the search engine’s eyes. Eventually, the old URL will be de-indexed and replaced by the new one.
So when do you use a 301? There are quite a few reasons why you’d want to permanently change URLs in the eyes of Google.
When To Use HTTP Code 301
When a Page’s Content Moves or Changes
The main reason people will use HTTP code 301 is when a post or page moves to a totally new location. An example of this is when a website audits their content and realizes they don’t need as many pages as they once did. They want to move to a single-page website, with everything sectioned off and available via scroll. The site can merge content that content, consolidating their Contact Us, About, Blog, and Subscribe pages.
The site would then follow our guide ‘s advice on setting up the 301s. All you would do is set the old URLs (/contact, /about, /blog, /subscribe most likely) to redirect to /home (or whatever slug you use for your home page. You can use simple a / as the target URL rather than a full site or even /home, but we’ve had a few issues where the 301 doesn’t always work. So we prefer a custom slug.
When There’s a Typo or Bad URL
Sometimes, the URL is just wrong. Or bad. Maybe you typed in /post-nmae instead of /post-name. Or maybe you have an automatic post importer (or a staff writer who doesn’t follow your style-guide) and you have a slug that looks like /podcast-season-5-episode-3-the-title-of-this-episode-is-too-long-but-whatever. You would definitely want to redirect it to something more friendly like /s5e3-long-title.
Performing an SEO Audit
If you’re performing an SEO audit of your site and notice that you have some non-optimized URLs, a HTTP code 301 is your way to go. You could change a /is-divi-the-best-page-builder-a-review-and-what-i-think-about-it to /divi-page-builder-review to better capitalize on the keyword. Just make sure your keyword and URL change is still pertinent to the content.
To Create a Branded Redirect
Just like URL shortening services and tracking URLs, you might want to take an unfriendly, cumbersome URL and turn it into something branded for your site. If you have a Discord server, and the invite URL is discord.gg/RYr2eD, and you want it to be easier to remember and share, you can create a redirect using HTTP code 301 from brandedwebsiteurl.com/discord or discord.brandedwebsiteurl.com.
Those are a lot easier to put on banners and use in links than the original. The same concept applies to promotions or courses or podcasts or whatever else. You can create 301s using unique URLs. You can 301 redirects to send myamazingnewpodcast.fm to brandedwebsiteurl.com/podcast. That way, you get the link juice from either URL, while keeping a unique URL for that project separate.
Sometimes, a website that’s been going for a long time has need to clean up the older content. Maybe that content is outdated, or maybe it doesn’t even apply or need to exist anymore. But the pages are still there, indexed by search engines. 301 them!
You can take the content, refresh it, update it, or even rewrite it. And as long as you publish it under a new URL, you can just redirect the old one on the same topic to it. You can take /the-best-fonts-for-2014 and update it to /top-2020-fonts, and you get the SEO power of the first one while boosting your new post, too.
Additionally, if you need to delete /the-ten-reasons-i-am-the-worst-person-ever, you can always set that URL to redirect to a similar post. Or your homepage. That way, instead of a 404 error when the search engines can’t find the content it’s looking for, it still sees your site. And not a gaping hole in your content.
What is a 302 Redirect?
Now consider the HTTP code 302. In particular, a 302 is a temporary redirect. By using a 302 over a 301, you’re telling search engines that the page in question hasn’t moved, that it still exists, that you’re just detouring the visitors for one reason or another. The search engine then won’t try to re-index the target URL to replace the old one. Google knows that you’re just taking a hiatus from that URL.
Remeber, because it’s a temporary redirect, absolutely zero link juice transfers via 302. That’s an important distinction between the two kinds.
When To Use HTTP Code 302
There are far fewer use cases for a 302 than there are for a 301. After all, how many times do you want to send users back to a typo-ridden URL or an outdated piece of content? 302s do have their uses, however, and we want to make sure that you’re using them correctly.
- When you are A/B testing a new site or design. You can see how people react to the new site or page without adversely affecting the other.
- When a site or page breaks for an unknown reason. Setting up a quick 302 redirect gives you time to troubleshoot and debug without worrying about affecting user retention.
- Similarly, when a site is undergoing maintenance, you can use a 302 to detour users into the alert page instead of them finding a broken or downed site.
- When your client/boss needs to give feedback on a feature or design. If you need to show off how something works in a production environment, a 302 is a good way to do that without affecting your SERPs.
These are some of the primary reasons to temporarily redirect from one page to another. HTTP code 302 is not meant to be used over a long period of time, but when you use them short-term and for the right reason, you should not see a noticeable impact on your SEO and SERPs.
Wrapping Up with HTTP Code 301 and 302
As you can see, there are a lot of different reasons to use the HTTP code 301 and 302. The internet changes, and your website is going to change, too. You will need to adjust things on a production site at some point. The important thing is that you know how to adjust them without having a negative impact on your users, your SEO practices, and SERPs.
Do you have any other best practices for redirecting pages? Let us know in the comments!
Article featured image by Indie Design / shutterstock.com
The post When to Use HTTP 301 and 302 Redirects for the Best Results appeared first on Elegant Themes Blog .