What is a 301 Redirect?

Have you ever tried to visit a website but ended up being redirected to a different page? That’s what we call a 301 redirect. A 301 redirect is a way to send website visitors from an old URL to a new URL. It’s commonly used when the original URL cannot be accessed anymore.

When a user comes across a page that is no longer valid, it can be frustrating for them. That's why it's important to create a redirect. A redirect will send users to the most relevant or similar live page to the one they were looking for.

What is a 301 redirect?

When a web page is served to a human or search engine spider by your website server, a status code is also served in the header. This code is received before the actual content of the page and informs your browser about the type of content on the page, such as an image, PDF, video, HTML, etc. Sometimes, this status code is a 301 redirect.

A 301 redirect is a response status code in the HTTP (HyperText Transfer Protocol) that indicates to the browser that the URL requested has been moved permanently to a new location. It can also be displayed as ‘301’ or ‘301 Moved Permanently’. This status code doesn’t necessarily indicate something negative; it simply informs the user that the requested URL has been redirected to another one, and the new one will be displayed by the browser. Receiving a 301 response means that you are helping your users avoid landing on old, irrelevant, or broken pages, thereby keeping your website organized and user-friendly. 

When should you use 301 redirects?

When a web page has become irrelevant or has been removed, you can use 301 redirects to ensure that users are directed to a relevant and up-to-date page. This is especially important when rebuilding a website and cleaning up URLs to make them more user-friendly. It is essential to redirect all old URLs that will no longer be the same after the rebuild. Creating redirects will help avoid any potential confusion or errors for users trying to access your website.

301 redirect use cases:

  • Moving your website to a new domain name

  • Cleaning up dynamic URLs and redirecting them to shorter, search engine-friendly versions

  • Minimizing duplicate content

What is the difference between a 301 redirect and the rel=“canonical” attribute?

The rel=“canonical” attribute is often misused as a substitute for 301 redirects, but it serves a different purpose. To clarify, let’s understand the difference between the two.

  • When you use a 301 redirect, users are automatically sent to a new page. This type of redirect is permanent. For example, if a user tries to visit “Page A,” they will be redirected to “Page B.”

  • The rel=“canonical” attribute helps to avoid the problem of duplicate content. It informs search engines which version of a set of similar pages should be indexed. For instance, instead of displaying “Page B listing products alphabetically,” favor “Page A listing products by price” instead.

SEO benefit of 301 redirects

301 redirects are critical for SEO and can determine site success. They are highly useful. Some benefits include:

Keeping visitors engaged in your site

When a visitor encounters a broken link, it can negatively impact their experience and lead to frustration. One way to prevent this issue is by implementing 301 redirects.

Link equity

Redirects play an important role in SEO, especially when it comes to preserving the link equity of a redirected page. When it comes to 3xx redirects, 301 redirects are preferred because they can pass on about 90% of the link equity to the new URL, whereas 302 redirects are temporary and may not pass on the link equity to the new URL. Due to this, it is advisable to use 301 redirects for preserving link equity and maintaining SEO.

Removing old URLs from a search engine’s index

When a search engine spider crawls through your website and comes across a 301 redirect, it will direct visitors to the new URL if they try to access the old one. This means that, over time, the old page will be replaced with a new one in the search engine's index.

Problems with 301 redirects

Improper or incorrect use of 301 redirects can lead to problems. This is often the case when a website owner redirects all old site pages to the new homepage while slimming it down. To avoid these issues, take the time to create new pages or categories, and make sure the old page is redirected to the most relevant new page. Always keep the user experience in mind if you want to increase website views. The easier your website is to use, the more visits it will receive.

It's also common for website owners to face the issue of redirect chains while using 301 redirects. Redirect chains occur when users are redirected through multiple pages. It's easy to fall into this trap after updating a website, but it's important to be aware of these chains and avoid them while creating your redirect list.

An example of a redirect chain:

  • Page 1 has a lot of backlinks but you want to direct it to Page 2

  • While the site is being updated, Page 2 gets redirected to Page 3

  • Then, Page 4 becomes an attractive new page, so you redirect Page 3 to Page 4

Now you’ve got a chain of redirects that are trying to flow link equity from Page 1 to Page 4.

It’s important to remove any chains and ensure that each link on the old page redirects directly to the new one to provide a seamless user experience. For example:

  • Page 1 > Page 4

  • Page 2 > Page 4

  • Page 3 > Page 4

How to set up a 301 redirect

So far we’ve learned what 301 redirects are, their importance, and in which cases we should use them. Now, let’s learn how to implement them on your website.

301 Redirect: .htaccess

To configure a web server's behavior, one would often use a .htaccess file. This file is a simple text file that sits in the root directory of your website. To implement a 301 redirect, you need to have a .htaccess file in your root directory. If it does not exist, you can easily create and edit it using a plain-text editing tool like Notepad, Sublime, or TextEdit.

To understand what text your .htaccess file should contain, let's use a very basic example such as renaming a page on your website. For example, if you wanted to change a page’s URL from:

https://www.example.com/old.html

to:

https://www.example.com/new

To ensure the users are redirected to the new page from the old one, you need to add the following code to your .htaccess file:

redirect 301 /old.html https://www.example.com/new

Here’s an explanation of what the code above means:

1.     “redirect 301” tells search engines (and browsers) that your page has been moved permanently

2.     “/old.html” – provides the old location of the page

3.     “https://www.example.com/new.html” – is the new location of the page you’re telling the server to redirect visitors to (this part of the code requires the complete URL to work properly)

If you want to move multiple pages, there should be a redirect statement for every page you want to move. Also, it’s better to have a unique line for each page as it ensures that the search engines can read your commands.

WordPress 301 Redirect

Implementing 301 redirects on WordPress sites is a fairly easy process and can be done by using plugins such as Redirection. With this plugin, creating a 301 redirect is as simple as entering the old URL and the new URL. This makes the process of implementing redirects faster and easier.

Redirection is not only useful for implementing redirects, but it also has other functions. For instance, it can identify broken links and 404s, import or export bulk redirects, and keep a log of which user agents/referrers have accessed the website and when. This log can be exported for log file analysis.

301 Redirect Timesaving Tips

Implementing 301 redirects for the first time can be tricky and time-consuming. Here are a few tips to help you save some time and make the process a bit smoother.

Keep your URLs the same on the new site, if possible

To ensure a smooth transition from your old website to a new one, it is recommended that you keep the URLs of the pages that will be on the new site the same as they were on the old site. However, if the URLs are not accurately descriptive of the content of the webpage, then you should change them. If it is possible to keep the same URLs, it will save time on mapping redirects and minimize the risk of traffic drops when the new pages replace the old.

Download your old URLs from as many sources as possible before the site is due to go live

Use a spreadsheet to keep a record of your old URLs long before your new site goes live. This way you’ll have enough time to map out old to new pages and dig through different sources for less obvious broken links/old URLs.

Filter your URLs and place them in order of length in the .htaccess or plugin

When using .htaccess to create redirects, the order in which the URLs are listed is crucial. The redirects are executed in the order they appear in the file. To ensure that the correct redirect is executed, it's important to sort the URLs by length and place them in the proper category. This can be achieved by using a length formula to count the number of characters in each URL. Then, sort the URLs into categories based on their length, and place shorter URLs at the bottom of each category. This will ensure that the longer URLs are redirected first, and the shorter URLs will only be redirected once the longer redirects have been completed.

Use formulas to complete straightforward chunks of redirect mapping

A use case might be where a category base has been added to a live URL, so all previous URLs just need the category added. Example: https://www.example.com/new-product to https://www.example.com/products/new-product

Wrapping Up

Hopefully, this article has helped you understand the significance of 301 redirects and how to use them. A 301 redirect is a method of informing search engines that a requested page has been replaced with a new one and redirects users to this new page. As it is related to your site's SEO, its importance cannot be overstated. 

Previous
Previous

What Is User Experience and Why It Matters

Next
Next

Introducing a Color Contrast Checker — PoundSix