Redirect Types

Sam Marsden
Sam Marsden

14 min read

In the previous section, we covered what redirection is and some of the issues that can arise as a result of poorly implemented redirects. Now let’s take a look at some of the different types of redirects so you can understand precisely how they work, when to use them and, just as importantly, when not to use them.
 

Server-side redirects

301 redirects

What are 301 redirects?

The 301 status code is usually the first choice of redirect for SEOs, and means that the URL has been moved permanently to another URL. Google has confirmed that a 301 redirect will pass most, if not all link equity, with only a slight loss of between 1% and 5% in most cases. 301 redirects are cacheable by default but can be overridden via explicit cache controls.

How long should you keep a 301 redirect active?

Google’s John Mueller recommends keeping 301 redirects in place for at least one year after they have been implemented. Google can take some time to fully recognize that a page has been moved permanently and you may still have visitors to the old version of the page if there are still links to it. John went on to say that there is also no problem with keeping 301 redirects in place permanently, however, this isn’t always feasible.

When to use 301 redirects

301 redirects should be used for the purposes of consolidating incoming links, preventing dead ends within a site and for preserving link equity. Broadly speaking, 301 redirects are implemented when you want to move all of the SEO value to the destination URL after the source has changed permanently.

To give you some context, here are some typical use cases where 301 redirects would be a good option:

When not to use 301 redirects

It is not usually recommended to use 301 redirects when caching because this can lead to unexpected results, as in the following examples:

Geotargeting

Device targeting

A/B testing

302 redirects

What are 302 redirects?

A 302 Found status code indicates that a URL has been temporarily moved to another URL. 302 redirects aren’t cacheable by default and search engines don’t immediately pass PageRank to the destination URL. Unlike a 301 redirect, a 302 doesn’t indicate that the destination URL should be indexed.

When to use 302 redirects

A 302 redirect is the correct choice when a temporary redirect is required that does not affect a webpage’s search engine presence. Here are a few scenarios where 302 redirects would be appropriate:

When not to use 302 redirects

Conversely, 302 redirects should not be used when:

303 redirects

What are 303 redirects?

A 303 “See Other” status codehttps://www.w3.org/TR/WCAG20-TECHS/F40.html also indicates a temporary redirect, stating that the target resource isn’t available but there is a resource which is descriptive of the original. With a 303 redirect, the request method for the destination URL is always “GET” but, unlike 302 redirects, they are never cacheable rather not cacheable by default.

When to use 303 redirects

303 redirects are used in a similar fashion to 302 redirects, but they are sometimes preferred since they can never be cacheable e.g. when temporary redirects appear for undisclosed periods of time.

303 redirects can be used in all of the same scenarios listed for 302s that work with GET requests for subsequent requests. 303 redirects can also be used to prevent duplicate form submissions that can occur when clicking the back button in a browser.

When not to use 303 redirects

303 redirects should not be used when a POST request is required for subsequent requests and when the client does not support HTTP/1.1. They also shouldn’t be used for permanent redirects.

307 redirects

What are 307 redirects?

The 307 Temporary Redirect is another status code, similar to the 302 redirect. Like the 302 redirect, a 307 indicates a temporary redirect and isn’t cacheable by default. The 307 redirect was introduced with HTTP/1.1 and is more precise in stating that the page has been moved to a temporary location.

When to use 307 redirects

There aren’t many cases in which a 307 redirect would be required, as most crawlers treat them in the same way as a 302 redirect, and a 301 is the best option in most scenarios. A 307 redirect could potentially be used during site maintenance where the server has been identified by search engine crawlers as HTTP/1.1 compatible, however, this could be difficult to determine.

When not to use 307 redirects

307 redirects should not be used when permanent redirects are required and when the client does not support HTTP/1.1.

308 redirects

What are 308 redirects?

The 308 Permanent Redirect is the permanent counterpart to the 307 Temporary Redirect. A 308 redirect only differs from a 301 redirect in that it forces the request method and payload of the subsequent request to be the same as of the original request.

When to use 308 redirects

A 308 redirect should be used when it is required to use the request method of the original request for subsequent ones. Here are some examples when 308 redirects might be used:

 

Client-side redirects

Client-side redirects are a forwarding method whereby the HTML itself tells the browser to redirect to another URL. These types of redirects can be useful if you do not have access to implement server-side redirects. However, there is less technical information available to search engine crawlers about the nature of client-side redirects, making them difficult to interpret. On top of this, not every browser supports all client-side redirects.

Meta redirects

Meta redirects can be used to instruct the browser to refresh the current page, or load another URL. The meta refresh element has to be within the HTML <head>, and the following example would trigger an immediate client-side redirect to the URL specified:

meta redirect example

The content attribute can be changed to specify the number of seconds before the redirect is triggered, however anything other than “0” is against Web Content Accessibility Guidelines (WCAG).

It is normally not recommended to use a meta refresh, as it was commonly used many years ago for sneaky redirects, sending visitors to a different URL to the one they initially requested.
It can be seen as deceptive to search engine crawlers and can potentially cause ranking drops and usability problems, as the original URL may be indexed and without following the redirected URL.

JavaScript redirects

JavaScript redirects are another client-side alternative to the meta-refresh. These redirects require the client to be able to interpret Javascript, which is why in most cases it is better to implement a 301 redirect because there are fewer client requirements.

Google says using JavaScript to redirect users can be a legitimate practice. For example, redirecting users to an internal page once they’re logged in. Since JavaScript redirects follow logical based commands, they could be be used for device or browser-specific redirects. For example:

if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
window.location.replace(“https://www.example.com/”);
};

 

Start detecting redirect issues now

If you’re interested in finding out if your site has redirect issues, then get started with a DeepCrawl account. You’ll have access to our range of technical SEO reports and be able to identify redirect chains and loops which could be negatively impacting your site.

Get Started Now

Author

Sam Marsden
Sam Marsden

Sam Marsden is Deepcrawl's Former SEO & Content Manager. Sam speaks regularly at marketing conferences, like SMX and BrightonSEO, and is a contributor to industry publications such as Search Engine Journal and State of Digital.

Choose a better way to grow

With tools that will help you realize your website’s true potential, and support to help you get there, growing your enterprise business online has never been so simple.

Book a Demo