SEO Process

Redirects for Beginners: How to Set Them Up + Best Practices

Nik Trifonov
Published: Jul. 03, 2024
Redirects: How to Set Them Up + Best Practices

Redirects are instructions to servers that automatically send a user from one webpage to another. They guide users and search engines to a new page when an old URL has changed or is no longer available. 

As an SEO pro, redirects are likely going to be part of your job, so it’s important to have a thorough understanding of them.

Some common types of redirects you might encounter are:

  • 301 redirect “Moved Permanently” — recommended for SEO. 
  • 302 redirect “Found” or “Moved Temporarily” — preferred over 307. 
  • 303 redirect “See Other.” 
  • 307 redirect “Moved Temporarily.” 
  • 308 redirect “Moved Permanently.”

The impact a redirect has on SEO will differ depending on which one you use and how you implement it.

To help you understand how redirects affect your SEO efforts, I’ve put together this article, which will cover:

  • Types of redirects
  • When you should use redirects
  • How they impact SEO
  • How to implement them correctly

Let’s dive in.

When to Use Redirects

There are several instances when implementing redirects is beneficial to your website. 

Let’s look at a few examples.

1. Updating Old Content

You might have outdated content that no longer brings value to people. In this case, you can use 301 to redirect pages with old content to new URLs. 

For example, TTT redirected an old technical SEO course page to a new URL.

  • From: https://trafficthinktank.com/courses/technical-seo-introduction/ 
  • To: https://trafficthinktank.com/topic/technical-seo/ 

So, if you try to access the old page, you’ll be promptly redirected to the new one. 

TTT Redirect SEO Pro Extension for Chrome

2. Moving From HTTP to HTTPS

Search engines treat the HTTPS version as your website’s preferred and secure version.

Google even considers it a minor ranking factor:

“…we’ve been running tests taking into account whether sites use secure, encrypted connections as a signal in our search ranking algorithms. We’ve seen positive results, so we’re starting to use HTTPS as a ranking signal.”

That’s why all your website pages must be hosted using HTTPS protocol. If some pages return the HTTP code, use the 301 redirect to permanently migrate from HTTP to HTTPS. You do this site-wide with .htaccess rules, rather than on an individual URL level. 

With Semrush’s Site Audit, you can easily check if your website is properly redirected from HTTP to HTTPS. The number of redirects will be displayed in the “Overview” tab. 

Semrush site health

By diving deeper into the “HTTPS Thematic Report” from Semrush’s Site Audit, you can identify pages with internal links still pointing to non-secure HTTP versions.

These mixed signals can confuse search engines like Google, potentially causing the wrong URLs to appear in search results. To avoid this issue, ensure all internal links point to pages using the secure HTTPS protocol. 

Ian Howells, one of TTT Academy’s founders, wrote an in-depth guide on internal linking best practices. Check it out for more guidance. 

Semrush site health warning

You can also see all HTTP URLs on your website with ScreamingFrog SEO Spider. 

Here’s how:

Open ScreamingFrog, paste your website’s URL, and hit “Start.

Screaming Frog top bar

When ScreamingFrog finishes crawling your website, navigate to the “Security” tab in the upper menu and click on “HTTP URLs” in the table. 

If your website has any HTTP pages, you’ll see all of them here. 

For example, ScreamingFrog shows that trafficthinktank.com has only one HTTP URL that was permanently redirected to HTTPS. 

Screaming Frog HTTP pages

3. Managing Broken Links and 404 Errors

A 404 page is a non-existing page on your website that you’ve moved elsewhere or deleted.

If a user lands on a page that returns a 404 status code “Not Found,” they’ll be confused and leave your website. 

That’s bad for user experience and might negatively affect your website’s performance in search results. 

Even worse, if you have backlinks pointing to a non-existing page, the link equity will be lost. Here’s what John Mueller, Google’s Senior Search Analyst, says about this issue: 

John Mueller Twitter post

To avoid losing valuable links and keep your visitors happy, use a 301 permanent redirect to move non-existing pages with a 4xx error to the closest URLs.

Redirecting them to your homepage or unrelated pages isn’t a good solution …

Imagine going to a store looking for something specific, but the employee just points you back to the entrance.

Confusing, right? Your visitors will feel the same way and probably leave.

Here are steps to take for broken links:

  • Find and remove any internal links that lead to a broken page
  • If other websites link to your broken page, contact the site owners and ask them to link to a different page on your site instead.
  • Set a 301 redirect to the most relevant page
  • Add a “no index, no follow” tag

Over time, search engines will stop showing the broken page in search results.

4. Consolidating Duplicate Content

Duplicate content is identical or substantially similar content that appears on multiple URLs within one website. 

It can confuse search engines like Google and potentially harm your website’s ranking in search results.

For example, Google sees these URLs as duplicate content:

Non-www and www URLs

  • trafficthinktank.com
  • www.trafficthinktank.com

HTTP and HTTPS URLs

  • https://trafficthinktank.com
  • http://trafficthinktank.com

Trailing-slash (/) and non-trailing-slash URLs

  • https://trafficthinktank.com/
  • https://trafficthinktank.com

Capitalized and lower-case URLs

  • https://trafficthinktank.com
  • https://traFFicthinktank.com

Essentially, your website pages end up competing against each other for visibility because Google can’t determine which ones should be indexed and ranked.

If your website has duplicate pages, you’ll see them all in Semrush’s Site Audit report.

Navigate to the “Issues” tab to check how many pages have duplicates.

Semrush Site Issues Errors

You can quickly fix this issue with 301 redirects.

Here’s how:

Set up a 301 permanent redirect from the duplicate pages to the primary version of the content. This will help consolidate the link value and SEO benefits of duplicates on the chosen page.

5. Redirecting Based on Location 

Redirects can also be used to automatically send users to a specific website version based on their location. This is achieved by identifying the user’s IP address.

Although automatic redirects seem convenient for moving users to appropriate language versions of a website, they can sometimes frustrate visitors.

Imagine traveling from Italy to the USA and wanting to access a local website in Italian. With automatic redirects, you’d be redirected to the English version instantly!

On top of that, IP location detection isn’t always accurate.

A better approach, like the one used by the Oysho fashion brand, is to allow users to pick their preferred region and language. 

This gives them control and ensures they get the content they actually want to see.

OYSHO location-based redirect

6. Migrating to a New Domain 

A website migration is a process of moving your website to a new location, like a different domain name, hosting provider, or platform.

There are many reasons why you’d want to migrate a website. 

For example, you might want to host a blog on a subdomain instead of a subfolder, change your brand name, or revamp your website’s structure. 

While reasons may vary, the most important thing is to ensure people who visit your old website end up on the corresponding page on the new website.

To achieve this smooth transition, you have to implement 301 redirects. It will inform search engines that the move is permanent, and visitors attempting to access the old domain will be automatically rerouted to the appropriate page on the new domain.

A well-known example of website migration is Twitter’s rebranding as X in 2023.

  • From: twitter.com
  • To: https://x.com/ 
X Homepage

Types of Redirects

In the intro, I mentioned that there are several types of redirects, each serving specific purposes.

I want to explore them in more detail. Let’s start with the most commonly used redirects — server-side redirects

1. Server-Side Redirects 

A server-side redirect happens behind the scenes on a website’s server. It occurs before a page loads and ensures visitors and search engines are directed to the correct URL. 

Server-side redirects can be permanent or temporary and are commonly used for the following purposes.

301: Moved Permanently

This is the most common redirect type, which permanently moves a webpage or an entire website to a new URL. 

It informs browsers and search engines that the old URL should no longer be indexed, and all website traffic and link equity should be transferred to the new URL.

Here’s an example: 

  • Old URL: http://example.com/dog-toys-2010
  • New URL: http://example.com/dog-toys-2022 

So, when visiting the old URL, you’ll be redirected to the new one. 

Pro tip: avoid putting the current year in your URL to avoid having to redirect it in the future.

Redirect Graphic

302: Found and Moved Temporarily 

A 302 redirect indicates that a page was temporarily redirected to another URL. 

Here’s an example:

  • Old URL: http://example.com/page 
  • Temporary URL: http://example.com/temp-page 

While users might not see any difference with a 301 redirect (they just end up at a new page), search engines treat them very differently. 

Unlike 301, 302 redirects tell search engines, “Hold on, the original URL will be back soon.” Therefore, they don’t transfer any SEO value to a temporary page.

303: See Other Redirect 

When you visit a webpage, the server might send you to a different one instead, using a 303 redirect. This HTTP code tells your browser to visit a different page than the one initially requested.

This type of redirect is rare, but you can stumble upon it after submitting a contact form or completing an action on a website.

307: Temporary Redirect 

A 307 redirect tells your browser that the page you are looking for has temporarily moved to a different URL. 

It’s similar to a 302 redirect but with one key difference: a 307 ensures your browser uses the same action (GET or POST) to access the new address.

GET is a type of request a browser sends to a server when a user only wants to view a page. POST is when a user wants to send data (such as login details) to the server. 

3хх redirects

308: Permanent Redirect (Experimental) 

Like the 301 redirect, the 308 redirect tells your browser that a page has permanently moved to a new URL. 

In terms of SEO, link equity—the value passed by backlinks—and authority may also be passed on to the new page.

The only difference between 301 and 308 redirects is that 308 tells browsers to continue using the same POST or GET method when following the redirect. 

Gary Illyes, Google’s Analyst, confirmed that Google treats 301 and 308 redirects equally. 

Gary Illyes twitter discussion

2. Client-Side Redirects 

Unlike server-side redirects, which are handled directly by the web server, client-side redirects occur within the user’s browser using JavaScript or HTML. 

Let’s delve into the pros and cons of relying on this method.

Meta-refresh Redirect 

A meta-refresh redirect is different from other redirects because it happens directly in your browser (client-side) rather than on a server. 

This redirect tells the browser to redirect a user to a different page after a specific period. 

Here’s an example:

<head>

<meta http-equiv=”refresh” content=”5; URL=“https://backlinko.com/best-free-seo-tools” /> 

</head>

In this particular case, “5” is the number of seconds before the browser redirects a user to Backlinko’s blog post about SEO tools. 

Now, what should you use, HTTP or meta-refresh redirects?

Google suggests using meta-refresh redirects only if you can’t use server-side redirects for some reason. 

JavaScript Redirect

JavaScript redirects use client-side scripts to move users from one URL to another. This method is implemented within the web page’s code and is executed by the user’s browser. 

Here are examples: 

Redirect Type Code Example Description
location.href >window.location.href =
‘https://example.com/new-page’;
When this code loads, users are redirected to https://example.com/new-page
location.assign() window.location.assign
(‘https://example.com/new-page’);
Similar to location.href, this code loads a new URL: https://example.com/new-page
location.replace() window.location.replace
(‘https://example.com/new-page’);
It is similar to location.assign, but this code replaces the old URL in the history stack, preventing the user from navigating back to the original page.

Since Google executes JavaScript redirects after completing the URL crawling, your old URL will still be shown in search results, which may negatively impact your website’s SEO. 

Besides, Google might never see your redirect if it fails to render your page’s content for some reason. 

Therefore, I recommend using server-side redirects to permanently or temporarily redirect one URL to another. 

How Redirects Impact SEO

Now that I’ve broken down when to use redirects and the different types of redirects available, I want to shine a light on how they impact SEO.

Redirects are vital for SEO because they preserve link equity and ensure users and search engines are directed to the most relevant pages.

Let me explain this in more detail.

Preserve Link Equity

Link equity is like a vote of trust from one website to another, which can impact how well a website ranks in search results.

Since relevant backlinks are still among the most important ranking factors, keeping existing backlinks and building new ones is crucial for SEO success.

If you don’t redirect the link equity from old pages to new ones, it will be lost. You’ll have to start building backlinks from scratch, which is a lot of work. 

A better strategy is to use a 301 permanent redirect.

When search engines encounter a 301 redirect, they understand the content has been permanently moved to a new location. Consequently, they transfer most of the original page’s link equity to the new URL. This helps the new page maintain and improve its rankings.

Note that 302 temporary redirects don’t pass link equity to another URL. 

It means that any link juice passed on by websites linking to the original URL won’t be transferred to a new destination. 

For long-term SEO benefits, use a 301 redirect for permanent URL changes.

Send Users to Proper URLs 

Properly configured redirects ensure users are sent to the most relevant and up-to-date pages. It helps enhance user experience and prevent any navigational issues. 

This is especially important when content is moved or updated, as it maintains uninterrupted user access and lets search engines continue indexing the right page.

Potential Negative Impact on Rankings

Redirects can harm your website’s rankings if they aren’t configured correctly. 

Using redirect chains and loops (I’ll explain these later) or temporary redirects (302) instead of permanent ones (301) can confuse search engines. This confusion can lead to lost ranking power and make it harder for users to find your website.

The key takeaway? Take care of your redirects to avoid these SEO issues. 

How to Implement Redirects 

There are a few ways to set up redirects: manually using HTML redirects, through CMS plugins, or a .htaccess file. 

What’s best for you depends on your website and goals. 

Let me show you how you can implement redirects the right way. 

1. Plan Your Redirects

Before implementing any redirects, it’s crucial to define the scope of the work. Ask yourself:

  • Are you migrating an entire domain, a section of your website, or just a few pages?
  • Will you use permanent (301) or temporary (302) redirects?
  • What method will you use to set up the redirects?

For instance, you might want to redirect an entire blog section from a subdomain (blog.examplesite.com) to a subfolder (examplesite.com/blog/). 

In this scenario, determine how many blog pages must be permanently redirected to new URLs and plan the implementation. If your website runs on WordPress, which powers more than 43.4% of websites globally, you will have to use a redirect plugin (details on this later).

Addressing these questions will help you prepare effectively for the migration and ensure a smooth process.

2. Set Up Redirects 

As I mentioned earlier, websites powered by WordPress can use plugins to set up redirects without coding. 

The most popular SEO plugins for this purpose are Yoast SEO and All in One SEO.

You might need to upgrade to a premium version to access all features, including redirects. 

However, there are free alternatives available.

For example, with the Easy Redirect Manager plugin for WordPress, you can set up redirects by:

  1. Choosing a redirect type.
  2. Entering the new URL where the old page should redirect.
  3. Hitting “Save”.

That’s all it takes to make your redirect live!

This plugin also tracks the number of times your redirect has been used. In the example below, users encountered the old page 128 times and were redirected to the new page.

Easy Redirect Manager WordPress

If you use Wix, you can set up redirects directly within your account using the “URL Redirect Manager.”

Simply select the type of redirect, enter the old URL, and specify the new page where you want users to be redirected.

Wix Redirect

There’s one more way to set up redirects using a .htaccess file. 

The .htaccess file is a configuration file used on Apache servers to manage server settings, including redirects.

Make changes to your website’s .htaccess file only if you feel comfortable doing it because you have enough experience. You absolutely could break your website for both users and search engine crawlers if you don’t perform this step correctly.

See, if you have never worked with website code, you can accidentally make mistakes that cause redirect loops, which will prevent you from accessing your website (more about this issue below). Please proceed with caution. 

If you use WordPress, you can access the file with the WP Htaccess Editor plugin.

Here’s what the .htaccess file looks like:

htaccess file

Suppose you want to redirect all HTTP pages on your website to HTTPS, add the following piece of code below the “RewriteEngine On” line, like in the example above:

RewriteCond %{https} off

RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L]

If you want to set up a 301 redirect, use the following piece of code, but don’t forget to replace /old-page/ and /new-page/ with your target URLs:

Redirect 301 /old-page/ /new-page/

Good news! There are tools, such as Aleyda Solis’s Htaccess Redirects Generator, that you can use to automatically generate redirect rules for the .htaccess file.

Aleyda Solis htaccess generator

3. Test and Monitor Your Redirects 

Once you set up redirects, you must ensure they properly redirect users to the proper URLs.

There are many ways to do it. 

First, you can manually check whether your redirect works. Type your old page’s slug in the search bar, hit “Enter,” and see whether it will redirect you to the new page. 

For example, Backlinko uses 301 to permanently redirect its old article (seo-tools) to a new URL (best-free-seo-tools).

So, if you try to access the old URL, you’ll be immediately redirected to the new one, as shown here:

Backlinko redirect

While manually checking redirects might be suitable for a handful of pages, it becomes impractical for larger tasks. Imagine redirecting an entire subdomain or even your whole website – that’s a lot of URLs to test by hand!

Instead, you can use various crawling tools, like Google Search Console, Semrush, or Screaming Frog. 

With Google Search Console, navigate to “Settings”>“Crawl stats report” >“By response” to see all redirect types on your website and the number of redirects.

GSC Crawl Stats

You can also use Semrush’s Site Audit to track the number and types of redirects. 

Head over to the “Overview” tab within Site Audit to see the current number of redirects on your website. 

The best part? Unlike manual checks, Semrush lets you run website audits frequently — weekly or even daily. It ensures you always have the latest website performance data, including redirects.

Semrush site audit redirects

In addition, you can also use ScreamingFrog. This is an advanced tool for SEO experts, but it offers a quick way to crawl your entire website. 

It has a free plan that lets you crawl up to 500 pages. If your website is larger, though, you might need to upgrade to a paid license.

Screaming Frog redirects

4. Update Your Sitemap and Internal Links

Don’t forget to delete old URLs from your website’s sitemap and remove all internal links pointing to old pages. 

This helps search engines understand which pages are important and should be shown in organic search results.

If you use WordPress or any other content management system, use SEO plugins to make changes to a sitemap. 

For example, with the All in One SEO plugin, you can choose post types (categories, tags, author pages, etc) that will appear in the sitemap and manually add new URLs. 

AIOSEO sitemaps

5 Best Practices for Redirects 

Now that we’ve covered the basics of redirects, let’s dive into some pro tips I’ve picked up over the past years of my SEO career when it comes to redirect best practices. 

1. Redirect to Relevant Pages Only 

If you set up a redirect, ensure you move users to a closely related URL. 

Users landing on broken or irrelevant pages will be confused and might choose to leave your website. 

Search engines like Google consider poor user experience, including high bounce rate and low dwell time, a negative signal. 

2. Avoid Redirect Chains and Loops

A redirect chain happens when you click on a link, but instead of going straight to the intended page, your browser takes a detour. It might visit a couple of other pages in between before finally landing on the right one.

Like this:

Redirect Chain

Redirect chains are bad for SEO because they make it harder for search engines to find and understand your website. Crawlers might get lost or give up before reaching important pages on your website.

Here’s what Google says about redirect chains:

“Googlebot follows up to 10 redirect hops. If the crawler doesn’t receive content within 10 hops, Search Console will show a redirect error in the site’s Page Indexing report. “

GSC Pages with redirects

A redirect loop happens when a webpage keeps redirecting to another page that redirects back to the original, causing an endless cycle.

Like this:

Redirect Loop

You might even lose access to your website due to redirect loops. That’s what I mentioned earlier. 

This issue happened to the following website, where the non-www WordPress login page kept redirecting to the www version of that page, which then redirected back to the original non-www page.

Checking redirects with Chrome extension

To get rid of a redirect loop, you must remove redirects that cause this issue. 

If you run a website using WordPress, you can turn off a redirect plugin with the file transfer protocol (FTP) server, such as FileZilla. 

If you can’t access your website’s FTP server, try contacting your web hosting provider. They can help you access the FTP server and remove faulty redirects. 

Hosting support chat

You can also use Semrush’s Site Audit to find and track any redirect chains and loops on your website.

Semrush site audit redirect chains and loops

3. Use Suitable Redirect Types

Before setting a redirect, ensure you know what you want to achieve with it. 

A temporary (302) will redirect users to a new URL, but Google won’t pass link equity to a new page and will keep showing the old URL in search results. Use it for short-term instances, like website maintenance. 

However, Google has also shared:

If you have 302 redirects for the long run, we treat them exactly the same as 301 redirects anyway. So if you can’t work out how it works with 301 redirects, maybe 302 redirects would be an option, too.

If you set a permanent (301) redirect, the SEO value of an old page will be redirected to the new one. 

4. Avoid Using Meta-Refresh Tags and JavaScript(JS) Redirects

A meta-refresh tag is an HTML tag that instructs a browser to automatically refresh a page after a set interval, often used to redirect users to a new URL after a few seconds. 

In my experience, meta-refresh redirects aren’t recommended because they can create a poor user experience, cause confusion, and aren’t SEO-friendly compared to server-side redirects like 301 or 302 redirects.

I’d also avoid JS redirects to prevent redirect loops. JS redirects are more or less the same as meta refreshes, but they use a different programming language.

5. Backup Before Implementing Redirects

Before making any major redirect changes, create a complete backup of your website.

This acts as a safety net in case unforeseen issues arise during implementation. With a backup in hand, you can easily revert to your website’s previous state if something goes wrong. This ensures minimal disruption to your website’s functionality and user experience. 

Remember that a little planning goes a long way in keeping your website running smoothly during redirect updates.

Become an SEO Pro with TTT Academy

You might think SEO is easy until you start implementing some of those recommendations.

Skip the trial and error and learn from the best with TTT Academy

More than 40 SEO experts, including industry leaders like Aleyda Solis and Matthew Howells-Barby, are here to guide you. Get the support you need with:

  • 200+ hours of in-depth training
  • Monthly webinars led by experts
  • Exclusive Slack community

Ready to join us?

Learn more about joining TTT Academy today.