Get in touch with our team

05.05.2020

11 min read

Redirection: 301 & 302 Redirects

This article was updated on: 07.02.2022

Redirection refers to the process of diverting a user or search engine crawler from the URL they requested to a different URL, which can be achieved by using a redirect. This blog takes a deep dive into redirection, exploring the different types of redirect; ways to implement redirects (using plugins or otherwise), and potential problems with redirection.


The Different Types of Redirect

Several different types of redirect exist, each with their own HTTP status code:

  • 301 redirect (moved permanently)
  • 302 redirect (found/moved temporarily)
  • 307 redirect (moved temporarily) 
  • Meta refresh

301 redirects are the most common form and should be used in the vast majority of cases. Aside from 302s redirects, the other types should generally be avoided (more on this in a moment).

What Are 301 Redirects?

301 redirects are used to permanently redirect a URL to another location. When a user visits a URL that has been redirected elsewhere via a 301, their browser requests access to the page and the server responds by stating that the URL has been permanently redirected. As a result, the browser takes the user to the new URL.

For most redirection tasks, we would implement a permanent 301 redirect. There are SEO benefits to using a 301 redirect rather than one of the other types, the most important of which relates to link equity. When a 301 redirect is used, most of the link equity from the original page is passed on to the recipient page. Google’s Gary Illyes has even stated that no PageRank will be lost:

When Should You Use a 301 Redirect?

There are many situations in which you should use a 301 redirect. For example, when a particular page is outdated and has been replaced with another page, a 301 is used to redirect users from the old URL to its replacement. Equally, this can apply to an entire site refresh: if the new version of the site has different URLs to the original, you would use 301 redirects to divert users towards the new set of URLs.

The most widely applicable use of 301 redirects is to reroute users towards the full version of a site’s URL (including the ‘www’). When navigating towards a site, users often miss off this part of the URL to save time, entering sitename.com as opposed to www.sitename.com. It’s important to redirect users to the full URL to avoid canonicalisation errors. Following the same logic, site-wide 301 redirects are also used to divert users in the following scenarios:

  • When a user enters a http URL instead of a https.
  • If uppercase letters are used instead of lowercase.
  • When the trailing slash is omitted (e.g. https://www.websitename/page instead of https://www.websitename/page/).

Whilst browsing the Internet, you might also come across another interesting usage for 301 redirects. As part of their digital marketing strategies, large brands will often purchase other domains and use 301 redirects to divert visitors towards the URL of their main site, thereby increasing traffic and accruing link equity.

In some cases, these URLs will be variations of the main site name (or even misspellings), ensuring that users reach the site even if they input the URL incorrectly – for example, try navigating to facebock.com or googl.com. Other brands purchase high authority domains that are relevant to them purely as an off-page SEO tactic (the digital equivalent of mergers and acquisitions).

302 Redirects

A 302 redirect is used to indicate that a page or site has moved on a temporary basis. The lesser-used cousin of the 301, it is recommended that you avoid 302s in most cases due to issues with indexing. When a 302 redirect is implemented, search engines will take much longer to index the destination URL, during which time no link equity will be passed along. After a while, the 302 will eventually be treated as a permanent 301. 

When Should You Use a 302 Redirect?

You should only ever consider using a 302 redirect if you intend to bring the old page or site back at some point. During a site update or redesign, for example, you could use a 302 to send users to another page whilst the developers are working on the old one. We also use 302 redirects during A/B testing and to experiment with a new page design, allowing us to test how users respond to a new page without affecting the rankings of the old page.

307 Redirects

307 redirects are the successor to temporary 302 redirects under HTTP 1.1, the current Hypertext Transfer Protocol that determines how URLs work. Technically, 302s now mean “found” instead of “moved temporarily” as they did under HTTP 1.0 (although they still perform the same function). 

Whilst this may all seem pretty confusing, you don’t really need to worry about it. In practice, SEOs almost always use 302s for temporary redirects instead of 307s because of the way they are viewed by search engines: search engines unanimously treat 302s as temporary redirects. Most search engines interpret 307s in the same way as 302s, but not in all cases.

What Is a Meta Refresh?

A meta refresh is a form of redirect that works through individual pages rather than the server. You should avoid using a meta refresh because they pass less link equity along and take much longer to load than other forms of redirect. In the past, you may have seen URLs that prompt you to ‘click here if you are not redirected in 5 seconds’ – these would have been redirected using a meta refresh.

Ways to Implement Redirects

As we’ve established, the use of 301 redirects is preferable in the vast majority of cases. Once you’ve decided which redirect to implement, however, there are multiple methods of doing so depending on the type of web server that your site runs on (such as Apache or Windows/IIS).

Using the Redirection Plugin for WordPress

If your content management system (CMS) is WordPress, then the whole process is remarkably easy to complete using the Redirection plugin

  • The first step is to install the Redirection plugin by downloading it, unzipping it, and uploading the Redirection directory to your /wp-content/plugins directory. 
  • Next, enable it via the plugin management page in WordPress.
  • Finally, you’ll be able to find Redirection under Tools.

The Redirection plugin makes it easy to implement 301 redirects by simply inputting the source URL and target URL as in the image below.

The Redirection plugin interface

Unfortunately, if you don’t use WordPress as your CMS, then the process of implementing a 301 redirect is a little more complicated (but still manageable if you’re willing to persevere). Use the instructions below if your site runs on Apache or Windows/IIS.

Implementing Redirects for Apache Sites

To implement a 301 redirect on a site that runs on Apache, you’ll first need to locate your .htaccess file. Open up your file transfer protocol (FTP) and enable your FTP browser. Next, you’ll need to log in, then open up your root web folder (also known as root directory, root folder, or document root). You should find your .htaccess file in this folder.

IMPORTANT NOTE: if there’s no .htaccess file there, you’ll need to create one. For instructions on how to create a .htaccess file, look for a tutorial that’s specific to your FTP.

Once you’ve located your .htaccess file, open it up using a HTML or code editor such as Visual Studio Code. Now you need to insert a line in this file that instructs the server on what to do, which differs depending on whether you want to redirect a page or a whole site.

To implement a 301 redirect on an individual page, add a line with the following format (replacing the URLs with your own):

RedirectPermanent /old-file.html http://www.domain.com/new-file.html

Should you need to 301 direct your entire site, add a line with this format instead (again, replace the URL with your own):

RedirectPermanent / http://www.new-domain.com/

With your additional line inserted, add an extra blank line at the bottom of the .htaccess file (sometimes referred to as an “endline”). Now it’s time to test out your redirection by visiting the relevant URL in your browser.

Creating a Redirect for a Windows/IIS Site

To create a redirect for a Windows/IIS site, follow these instructions carefully:

  • Navigate to the Internet Information Services (IIS) Manager (Start > Administrative Tools > IIS Manager).
  • Select the relevant website from the list of your sites in the left-hand panel.
  • Check that the URL Rewrite module is present; if not, install it here.
  • Open URL Rewrite, then click Add Rules > Blank Rule > OK.
  • Give the rule a suitable, identifiable name.
  • Go to the Match URL Panel, choose Matches the Pattern for the requested URL, and select Using as Regular Expressions.
  • The Pattern field is where you specify the page that you want to redirect. As with Apache, the process differs for a single page or entire domain:
    •  If you want to redirect a single page, input the path and page name from the URL (to redirect this blog, we would input /blog/redirection-301-302-redirects).
    • To redirect the whole site, just put (.*) under Pattern.
  • Next, scroll down the Action panel. You’ll see an Action Type drop-down menu – select Redirect.
  • Under Action Properties, input the destination URL. Should you wish to redirect the entire site, type in the new URL followed by {R:0}.
  • If you’re using tracking parameters and you’d like these to be carried over, tick Append Query String.
  • In the Redirect Type field, click Permanent (301) and then click Apply in the Actions column.
  • Finally, test out your redirection by visiting the original URL in your browser.

Potential Problems with Redirection

We’ve covered the different types of redirect, their uses, and various implementation methods, but haven’t touched upon any of the potential complications associated with redirection just yet. Used correctly, redirects are a helpful way of diverting users to the content you want them to see and transferring link equity at the same. There can be issues, however, if redirects are used excessively.

Too Many Redirects Error

Whilst browsing, you may have come across the error message “ERR_TOO_MANY_REDIRECTS.” As the name suggests, this occurs when too many redirects have been attempted on a particular page of a site. The too many redirects error is often associated with a redirect loop, a situation in which URL A is redirected to URL B and then back again ad infinitum. It’s important to be careful when implementing 301 redirects, ensuring that you avoid any troubles with redirect loops. (You can use a website crawling tool like DeepCrawl to identify existing redirect loops on your site.)

Redirect loop error message

Redirect Chains

Whilst redirect loops involve an endless series of redirects between two URLs, a redirect chain occurs when one URL redirects to another then another (and so on). Redirect chains slow down the speed at which the destination page will load, causing problems from a user experience (UX) perspective. During the time it takes to arrive at the final page, many users would have left the site.

There are also SEO issues associated with redirect chains. According to Moz, each step in a redirect chain causes around 10% of link equity to be lost. Theoretically, then, a long series of 301 redirects could result in the total depletion of link equity by the time you get to the final destination URL in the series. Multiple redirect chains across a site can have aggregate effects on its authority as a whole.

Rather than using a chain of redirects when a page on your site is repeatedly updated over the years, cut out the middleman by implementing a 301 redirect straight from the source URL to the destination URL. To check if there are redirect chains already in place on your site, use a tool like DeepCrawl.

Conclusion

We’ve covered a lot of ground regarding redirection over the course of this blog, so it might be helpful to finish off with a quick roundup of the key takeaways. At the beginning, we looked at the different kinds of redirects including 301s (moved permanently); 302s (found/moved temporarily); 307s (the HTTP 1.1 version of moved temporarily), and meta refreshes. You should be using 301 redirects in most cases, but 302s can be used if you plan on restoring the old page.

Next up, we explored three different ways to implement redirects depending on the web server that your site runs on. For WordPress users, the process is made easy by using the Redirection plugin. If your site is on Apache, you’ll need to edit your .htaccess file (follow the instructions outlined above). Redirects can be implemented on Windows/IIS sites using the IIS Manager. The final section explained some common redirection errors and how to avoid them, including redirect loops (the too many redirects error) and redirect chains.

Hopefully this guide has provided you with some insight into redirection and helped you to implement redirects on your site. If you need help with any aspect of your digital marketing, don’t hesitate to get in touch!