Redirects: What They Are & How to Use Them

Kelly Lyons

Dec 12, 202412 min read
Contributors: Yannick Weiler, Mariya Delano, and Simon Fogg
redirects
Share

TABLE OF CONTENTS

What Is a Redirect?

A URL redirect (sometimes called “URL forwarding”) sends users and search engines to a different URL than the one they initially requested.

You can use redirects to move a webpage to a new address so that both visitors and search engines automatically reach the correct page.

Common redirect types include 301 (moved permanently), 302 (moved temporarily), and meta refresh.

Why Are Redirects Important?

Redirects are important for two key reasons:

Redirects Ensure a Good User Experience

Redirects ensure visitors don’t land on broken or duplicate pages.

For example, consider a blog post about “the best SEO courses in 2024” at “yourgreatsite.com/blog/best-seo-courses-in-2024.”

If you update the blog post in 2025, you might want to remove the year and publish it under “yourgreatsite.com/blog/best-seo-courses.”

Changing the URL makes the old URL inaccessible.

However, some users may have bookmarked the old URL or shared it on social media. The old URL may also still appear on search engine results pages (SERPs) for some time.

If users click on the old URL without being redirected, they’ll see a 404 error response.

A browser with the url “yourgreatsite.com/blog/best-golf-courses-in-michigan-2023” in the browser bar and “Whoops! 404” displayed on the webpage

If visitors expect a certain page and end up on an error page instead, they’ll likely have a poor experience and leave. 

Use redirects to prevent confusion or frustration.

Before setting a redirect, ensure the old page has a meaningful replacement. If there’s truly no relevant replacement, provide an informative 404 page.

Redirects Can Preserve Search Performance

Redirects can transfer ranking authority from an old page to a newer version to maintain rankings and traffic.

Imagine that the old URL “yourgreatsite.com/blog/best-seo-courses-in-2024” accumulated numerous backlinks and consistently brought in a large volume of monthly traffic. 

By applying a redirect to a newer, updated page, you can effectively transfer the original page’s ranking signals and traffic value to its replacement.

When to Use Redirects

Sites typically use redirects in the following situations:

  • Moving a webpage’s URL (from URL A to URL B)
  • Deleting a page
  • Adding category tags or parent pages that change URLs
  • Migrating a website to a new domain
  • Adjusting URL naming conventions
  • Merging two or more duplicate webpages
  • Switching a site from HTTP to HTTPS

You can apply a web redirect to a single URL, a group of URLs, or an entire domain.

Types of Redirects

There are two main types of redirects—permanent and temporary—that serve different purposes.

Users can’t tell the difference. However, search engines treat permanent and temporary redirects differently.

Use permanent redirects when you don’t expect to display the old page again (e.g., use a permanent redirect if you combine duplicate pages). Permanent redirects tell search engines to remove the old URL from search results and display the new one.

Use temporary redirects when a webpage only needs to be redirected for a short period. For instance, if you have a page dedicated to a limited-time holiday sale or a one-off event, you can temporarily redirect visitors to an alternate page once the sale or event concludes.

Now, we’ll examine the main redirect types:

HTTP Redirects

HTTP redirects use a special code in the HTTP response that instructs the browser to go to a different webpage.

The redirection process works like this:

The browser requests the old (redirected) URL, and the server automatically displays the webpage for the new URL (the redirect target).

From the user’s perspective, HTTP redirects are seamless.

Technically, HTTP redirects are server-side redirects. The web server handles the redirect before the website loads.

The server returns a 3xx HTTP code when it receives a request for the redirected URL. These 3xx codes instruct the browser that the requested URL has been redirected and indicate the new page’s location.

Common 3xx codes include:

301 Redirects (Moved Permanently)

301 redirects tell search engines that the move from one URL to another is permanent, which helps to pass link equity and preserve the original URL’s ranking strength.

For example, consider a site with two pages about a similar topic. If one page is outdated, there’s no need to keep both pages.

old page redirects to new page at different url

In the case of having duplicate pages where one is outdated, delete the outdated page and use a 301 redirect to the new page’s URL.

302 Redirects (Found & Moved Temporarily)

302 redirects tell search engines that the redirect is temporary.

Use a 302 redirect in these cases:

  • You temporarily move a page to a new URL
  • You need to take a page offline briefly for maintenance
  • You want to A/B test new design or copy

Google will continue to index the original URL, and the redirect won’t pass ranking strength to the new page.

Because ranking strength doesn’t transfer to the new page, using a temporary redirect by mistake can harm search rankings.

Check for redirect issues by running a site audit with Site Audit.

Go to the “Issues” tab and type “redirect” into the search bar to see the number of URLs with temporary redirects.

Results for "redirect" under the "Issues” tab in Site Audit

Review the affected URLs to confirm if they should remain temporary redirects.

Only use a 302 redirect if you intend to restore the original URL later.

If you’ve used a 302 redirect accidentally, change it to a 301 redirect.

Other HTTP Redirects

In most cases, only 301 and 302 redirects are needed, but there are some less common HTTP redirects:

  • 303 redirect (see other): Sends users to another relevant page when the old one is unavailable, often after a user has completed a form submission
  • 307 redirect (moved temporarily) and 308 redirect (moved permanently): Similar to 302 and 301 respectively. These two types of redirects were primarily needed for older browsers.

Meta Refresh Redirects

Meta refresh redirects occur at the page level (client side)—not at the server level like HTTP requests.

If you need to implement redirects, use HTTP redirects instead of meta refreshes whenever possible for better SEO.

Meta refresh redirects are often slower and can hurt the user experience. These redirects can also cause search engines to index the wrong page.

Google recommends meta refresh redirects only if you can’t use a server-side redirect.

There are two types of meta refresh redirects:

Instant Meta Refresh Redirects

Instant meta refresh redirects trigger as soon as the browser loads the page, and Google treats these as permanent redirects.

Instant meta refresh redirects look like this:

<meta http-equiv="refresh" content="0; url=https://www.semrush.com/">

Delayed Meta Refresh Redirects

Delayed meta refresh redirects trigger after a specified number of seconds, and Google treats these as temporary redirects.

Here is an example delayed meta refresh redirect that triggers after five seconds:

<meta http-equiv="refresh" content="5; url=https://www.semrush.com/">

JavaScript Redirects

JavaScript redirects are another type of client-side redirect but aren’t recommended for SEO because Google may fail to render the JavaScript on the page or encounter errors when doing so.

If the code doesn’t render or there’s another issue, Google may not notice the redirect and could continue indexing the outdated URL. If the old URL is the one indexed, it could continue to appear in search results and possibly harm your search rankings.

In fact, Google explicitly advises against using JavaScript redirects:

Google says "only use javascript redirects if you can't do server-side or meta refresh redirects. while google attempts to render every url googlebot crawled, rendering may fail for various reasons. this means that if you set a javascript redirect, google might never see it if rendering of the content failed.

Here’s an example of a JavaScript redirect in HTML code:

window.location.replace("https://example.com");

How to Implement Redirects

You can set up HTTP redirects in several ways, including the below options:

Use WordPress Plugins

You can use plugins like Yoast to set up redirects on WordPress.

First, download the Yoast plugin from the WordPress store and activate it.

Next, select “Redirects” from the Yoast menu:

Yoast SEO in WordPress toolbar and Redirects highlighted

Choose the type of redirect you want to use.

Enter the slug (the end portion of the URL) of the old URL and the new URL you want to redirect to.

Make sure you spell the slugs correctly. Otherwise, the redirect may fail.

Click “Add Redirect” to activate the redirect.

Use Wix

If you use Wix, set up redirects directly in the CMS.

Scroll down to the bottom of your website’s control panel and click on “SEO” under “Website & SEO.”

Wix SEO in navigation

Scroll down and click “Go to URL Redirect Manager” under the “URL Redirect Manager” option.

URL Redirect Manager highlighted

Click “+ Create New Redirect.”

A pop-up will appear. 

Select your redirect type, add the old URL, and add the target URL.

Click “Save” or “Save & Add Another” to finish.

Wix add redirect pop up

Use an .htaccess File

You can also set up redirects manually using an .htaccess file.

This file uses plain text and may look like the below image:

.htaccess file example

Apache servers use .htaccess files (though other servers can, too).

First, locate the RewriteEngine in the mod_rewrite module (in Apache).

This module should be enabled by default. If not, add it with the below code:

<IfModule mod_rewrite.c>
RewriteEngine On
</IfModule>

Place your redirect rules directly below “RewriteEngine On.”

Redirect a Single URL

To redirect one URL, specify the redirect type and replace “/oldpage/” and “/newpage/” with the actual page slugs:

Redirect 301 /oldpage/ https://www.example.com/newpage/

Redirect a Single Folder

To redirect a folder, use the below code and replace “folder” and “location” with your desired values:

RewriteRule ^folder/(.*)$ /location/$1 [R=301,NC,L]

Redirect to Another Domain

To redirect to a new domain, use this code:

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

Redirect Non-WWW to WWW

Redirect non-www URLs to their www versions to indicate that the www versions are correct.

Redirect a non-www URL to a www URL using this code:

RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

Choosing a single, consistent version (www) helps Google understand which version is canonical.

Redirect WWW to Non-WWW

Use this code if you prefer non-www URLs:

RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

Non-www URLs may be simpler for users to type. However, using non-www may limit your control over certain cookies.

Redirect HTTP to HTTPS

To redirect HTTP pages to HTTPS pages, use this code:

RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L]

Before redirecting from HTTP to HTTPS, make sure you’ve purchased and implemented a secure sockets layer (SSL) certificate.

5 Redirect Best Practices

We’ve covered how to set up various redirects. 

Now, let’s discuss best practices for redirects:

1. Redirect to Content That’s a Close Match

When you set up a redirect, ensure the new page’s content closely matches the old page’s content and satisfies the same user intent.

If no close match exists, use a 404 page instead.

See what Google’s John Mueller says about whether 404 errors should always be redirected:

Youtube video thumbnail

"If the user clicked on your site in search of a knife, they would be frustrated to only see spoons. It's a terrible user experience, and doesn't help in search."

Not following this guideline can lead Google to treat a page as a soft 404.

A soft 404 usually happens when the server sends a “200 OK” status code, but the page contains a “webpage not found” message.

Google can also treat a redirected page as a soft 404 if the new page is irrelevant.

You can identify soft 404s using Google Search Console.

Go to the “Pages” tab under “Indexing.”

Google Search Console Pages report

Scroll down to “Why pages aren’t indexed” and look for “Soft 404” in the “Reason” column.

soft 404 error highlighted

Fix the soft 404 errors you find.

If any soft 404 relates to redirects, update the redirect to point to a relevant page.

2. Avoid Redirect Chains & Loops

A redirect chain occurs when more than one redirect exists between the original URL and the final URL.

For example, if “www.yoursite.com/about-the-company/” redirects to “www.yoursite.com/about-us/” and “www.yoursite.com/about-us/” later redirects to “www.yoursite.com/about/,” you have a chain.

a redirect chain example shows url a redirects to url b which redirects to url c

Google can follow about 10 redirect “hops,” but long chains can delay crawling, lead to losses in link equity, and slow page load time.

Fix chains by redirecting the original URL directly to the final URL.

Corrected redirect chain with both url a and url b redirecting to url c

A redirect loop happens when the first URL redirects to the second URL and the second URL redirects back to the first URL, creating an infinite cycle.

Redirect loop shows url x redirects to url y which redirects to url x

This loop prevents the redirect from working.

Fix redirect loops by choosing the correct final page and ensuring that the final page doesn’t redirect elsewhere.

Use Site Audit to identify redirect chains and loops.

Open the “Issues” tab and search “redirect chain.”

Click on the “# redirect chains and loops” issue to get a full report of pages with redirect chain or loop errors.

Redirect chains and loops in Site Audit

The report contains a list of pages, their redirect type, and the number of redirects.

List of page urls with redirect link in Site Audit

Fix each redirect issue in your CMS

To summarize:

  • Fix chains by redirecting the old URL straight to the final URL.
  • Fix loops by selecting the correct URL and removing other redirects

3. Avoid Linking to Redirected Pages

If you redirect an old page to a new page, check whether any internal links still point to the old URL because extra redirects add complexity and can cause chains (even if users don’t notice).

In other words, linking to a redirected page adds another (unnecessary) step:

Linking to a page with a redirect shows blog post linking internally to an old page which redirects to the new page

Update old internal links to point directly to the new URL.

Avoid linking to a page that redirects to another. the blog post links internally to the new page

To find links that point to redirected URLs, open Site Audit and go to the “Crawled Pages” tab.

Site Audit Crawled Pages report

Enter the old URL that’s been redirected into the search bar and click the search icon.

Add your page to Crawled Pages search bar

Click the old URL in the report.

Crawled Pages report for one redirected URL

Click the number under “Incoming Internal Links” to see all the internal links pointing to your old URL and update them to the new URL.

4. Redirect to Avoid Duplicate Content

Sites often have multiple versions of the same page, which can cause duplicate content issues because search engines treat those different versions as being different sites. 

For example, “http://example.com” and “https://example.com.”

Prevent duplicate content problems by using 301 redirects to point all variants to a single, preferred URL.

Use redirects to handle the following scenarios that may otherwise lead to duplicate content issues:

  • Non-www and www URLs
  • HTTP and HTTPS URLs
  • Trailing-slash (/) and non-trailing-slash URLs
  • Capitalized and lower-case URLs

Find duplicate content in the Site Audit tool’s “Issues” tab. 

Type “duplicate” in the search bar to find relevant errors.

Click the “# pages have duplicate content issues” error for details.

Pages with duplicate content issues

You’ll see a list of pages that you may need to redirect and how many duplicate pages exist.

Page URLs with duplicate content issues in Site Audit

Click on the drop-down arrow on the right side of each listing to see the duplicate pages.

Examples of pages with duplicate content

Redirect each duplicate page as needed.

Google ignores backlinks pointing to 404 pages, and these lost links mean lost ranking authority.

Use Backlink Analytics to find 404 pages with inbound links pointing to them.

Go to the “Indexed Pages” tab and check the box beside “Broken Pages.”

Broken Pages in Backlink Analytic's indexed pages report

You’ll see a list of missing URLs that have links going to them.

redirect errors in broken indexed pages with internal links noted

Use 301 redirects to point the missing URLs to relevant pages that closely match the old content to reclaim lost authority.

Redirect FAQs

Do Redirects Pass Page Authority?

Yes, permanent redirects can pass authority from the old page to the new page if their content closely matches.

However, a redirect may not pass 100% of the original page’s authority.

If you have a good reason to redirect a page, implementing the redirect is best practice.

Are Redirects Bad for SEO?

No, redirects aren’t inherently bad for SEO.

Google’s guideline is simple:

  • If the old page no longer exists and has no suitable replacement, don’t redirect
  • If the page moved to a new location, a redirect makes sense

If you redirect users to an irrelevant page, Google may treat it like a 404.

How Long Should You Keep Redirects in Place?

Google recommends keeping 301 redirects in place for at least one year.

In a video from Google Search Central, John Mueller from Google said:

When a URL changes, our systems need to see the change in the form of a redirect for at least a few times in order to record that change. To be certain that a redirect has been seen a few times, we recommend keeping the redirect in place for at least one year.

For users, keeping redirects indefinitely is best for ensuring users never encounter errors that cause them to leave your site.

How Do I Test Redirects?

You test redirects by copying the old URL, pasting it into your browser, and hitting enter to see if you’re taken to the new URL. 

If so, the redirect works.

If not, check for typos or errors in your redirect setup.

Share
Author Photo
Writer, editor, SEO strategist, and supporter of the Oxford comma. There‘s little I enjoy more than lounging on my couch playing video games and snuggling with my dog.
More on this