Which redirect should I use?

As an SEO or website owner, sooner or later you are bound to run into redirects. Whenever you delete a page, change your URL structure or switch to a new domain, you’ll have to redirect your URLs. Changing URLs is really important for your SEO, but can be quite daunting. That’s why Yoast SEO Premium offers the redirect manager. That’ll make redirecting URLs a lot easier!

A redirect tells search engine robots to go somewhere else, either temporarily or permanently, to access a particular page. Choosing the wrong type of redirect might adversely impact your SEO, so be careful which you pick. This post explains the different types of redirects and when you should use them.

Pro tip: Tidying up your content? Make life easier for yourself with our new SEO workout! We’ll find your orphaned content and help you to either improve it and link it, or remove it and redirect it. Give it a go and clean up that content!

Why use redirects?

In general, you should try to avoid redirects but if you do need them, please apply them properly. Redirecting URLs is part of your regular website maintenance. There are many reasons for using them, but these are the most common:

HTTP status codes

To understand how redirects work and how you can influence what a server returns to a browser, you need to know about HTTP status codes. An HTTP status code is a set number that a server sends to a browser following a particular request for a page. These codes may include 200, 301, 404 and 503, for example, and each code serves a particular purpose. A 404, for instance, indicates that a page has not been found. A 503 means that the server is temporarily offline for maintenance or due to overload.

If you want to maintain your site faultlessly, you need to know your HTTP status codes, and you can read up on them in more detail here: HTTP status codes and what they mean for SEO.

Types of redirects

There are a couple of redirects that you’ll run into on a daily basis, so it’s a good idea to remember them:

  • 301 Permanent
  • 302 Found
  • 307 Temporary

These aren’t really redirects, but still useful:

  • 410 Content deleted
  • 451 Content unavailable for legal reasons

301 Permanent redirect

The 301 is one of the most common redirects, and you should use this if you permanently want to redirect a deleted or moved page, or if you’ve changed something in your permalink structure. This code tells search engine robots that the page in question is no longer available at this location and that it should not be indexed anymore. If you don’t set a redirect correctly, the chances are your visitors – and crawl bots – will see 404 error messages – and that’s not something you want to happen.

Since a 301 permanently leads visitors from the old URL to a new one, you should only use it if you’re sure you’ll never use the old URL again. If you do want to use the URL again, you need a temporary redirect instead. A 301 passes all the link value a discarded URL has accumulated over the years over to the new URL, so it causes the new URL to gain or retain value. To learn how to implement your 301 redirects with WordPress, read this post by Jimmy or just use the redirect manager in Yoast SEO Premium.

302 Found

A 302 is a fairly ambiguous redirect and is often used as a temporary one. The code means that the requested content has been found, but it lives in a different location. It doesn’t say why. If you want to send visitors to an alternative page when visiting this particular page, and you want to reuse the URL in the future, use a 302.

Since this is a temporary redirect, Google expects something to return later. If you leave the 302 for a long period of time, Google will start treating it as a 301 and passing along any of the value that link had.

307 Temporary

302s are often used to create temporary redirects, but, with the advent of HTTP 1.1, 307 has replaced it as a valid temporary redirect. While a 302 is a little vague, a 307 states precisely that the requested URL has been moved to a temporary location and will be back in a while. Since this request can change in the future, the request should continue to be made using the original URL. Use this redirect if you’re sure the move is temporary and you’ll still need the original URL later on.

Not really redirects, but still relevant

As well as the traditional codes, you’ll find two more that don’t really redirect. However, these are still relevant for day-to-day maintenance work on your site. You could see 410 and 451 as your server saying: Hey, there used to be something here, but not anymore.

410 Content deleted

404 error pages are one of the biggest problems on websites, and if you look at your readouts in Google Search Console, you are bound to find a few. These must be fixed because no-one likes these errors: Google sees them as a sign of bad maintenance, and visitors are confused by them. 404 errors often occur when the requested page or post has been deleted from the site and the URL has not been redirected.

Use a 301 to redirect pages showing 404 errors to a relevant page, or the homepage. Sometimes, however, you might prefer another method: telling search engines – and users – this page has been deleted with a 410 redirect. They will then know that the page won’t return and can, therefore, delete the page from the index.

Should you ever be unlucky enough to be ordered by a judge to delete a page or if you get a notice and takedown request, give the deleted page a 451 header. This tells search engines that there was a post here and that you wanted to fulfill this request, but you can’t for legal reasons. Find out how and why to make a 451 header, should you ever find yourself in that situation.

REGEX redirects

If you’re a professional SEO and you need to do complex redirects, you may need to use REGEX redirects. With normal ones, you specify a single source URL and a destination URL. With REGEX – regular expressions – redirects, you can, for instance, create a single one to move entire groups of URLs that include a keyword to a new location. This could save you a ton of time while working on a massive SEO project. However, you should only use REGEX if you know what you are doing because they can easily break your site.

Manage redirects with Yoast SEO Premium

Of course you can fix your redirects on the server or use other tools, but, as a user of Yoast SEO Premium, you have the best possible tool to work with redirects at your disposal. The redirect manager in Yoast SEO Premium helps you set the correct one, and whenever you delete or move a page, Yoast SEO will ask you how to treat it: should it have a 301 or a 410? Or maybe a 451? The redirect manager supports 301, 302, 307, 410 and 451 redirects, all in an easy to manage workflow.

Working with redirects

Working with redirects is a daily job for many SEOs. This article has covered the different options for redirecting pages and shown you how and when to use them. But be careful when choosing! And don’t 302 your entire site when you’re moving to a new domain because you’ll cause serious problems down the line. Think about what you want to accomplish, and then pick the most appropriate method.

Read more: How to properly delete a page from your site »

Coming up next!


8 Responses to Which redirect should I use?

  1. Glenn
    Glenn  • 4 years ago

    Thanks Edwin for sharing, this sure simplifies things and was very informative. Now I know how to handle the errors that I’ve been getting…

  2. Detlef
    Detlef  • 4 years ago

    What about import redirections?
    Could not find something like that.
    Detlef

  3. Romel Adhikary
    Romel Adhikary  • 4 years ago

    Helpful and informative article. thanks for posting.

  4. zoederick
    zoederick  • 4 years ago

    This is a great comparison!
    Thanks for taking time and sharing it.

    • Camille Cunningham
      Camille Cunningham  • 4 years ago

      You’re welcome!