Redirects 101: A Beginner’s Guide to Setup & Best Practices

1 month ago 32
ARTICLE AD BOX

Redirects nonstop users and hunt engines from 1 URL to different automatically.

For example, erstwhile you effort to visit

https://backlinko.com/hub/youtube/position

(which has a redirect) it volition instrumentality you to

https://backlinko.com/hub/youtube/positioning

instead.

HTTP Status – URL presumption    check

Redirects usher users and hunt engines from outdated URLs to current, applicable content.

This improves the idiosyncratic experience. Preserves your hard-earned backlinks. And helps hunt engines crawl and scale your tract much efficiently.

Bottom line: Redirects tin assistance you negociate your website structure and improve your SEO.

When you usage them correctly, that is.

In this guide, you’ll learn:

  • What redirects are
  • How to instrumentality redirects the close way
  • Best practices for utilizing redirects

When to Use Redirects

Websites alteration and grow. And if you person a website, there’ll apt travel a clip erstwhile you’ll request to adhd a redirect.

Let’s look astatine immoderate examples of erstwhile you mightiness request them.

When to usage  redirects

Moving a Website (Site Migration)

Site migrations typically necessitate redirects, peculiarly successful the pursuing situations:

Changing Domain Names

If you’re switching from www.oldsite.com to www.newsite.com, each leafage from the aged tract should constituent to its nonstop counterpart connected the caller domain.

This ensures anyone trying to entree 1 of your aged pages inactive lands connected the applicable mentation connected the caller website. For much guidance connected this topic, cheque retired our website migration checklist.

Content Management System (CMS) Changes

Different contented absorption systems whitethorn signifier web addresses differently. For example, if you determination from WooCommerce (WordPress) to Shopify, immoderate of your URLs volition apt change.

Shopify uses /collections for categories. So yoursite.com/category/mens-clothing would go yoursite.com/collections/mens-clothing connected Shopify.

Without implementing redirects, users and hunt engines mightiness person a hard clip uncovering your caller pages.

International Expansion

Another benignant of website migration that whitethorn necessitate the usage of redirects is erstwhile you determination to a antithetic (country code) top-level domain. Such arsenic going from yoursite.com to yoursite.co.uk.

This is communal erstwhile website owners grow into different countries, and privation to person a website dedicated to each idiosyncratic market.

Deleting Pages

When you delete a leafage from your site, you tin usage redirects to constituent to a applicable oregon akin page.

For example, you mightiness person 2 pages covering the aforesaid topic. If you merge them into a longer, much implicit guide, you request to adhd redirects from some archetypal pages to the caller page.

Merging 2  URLs

Otherwise, if users effort to entree the aged (deleted) versions, they’ll get a 404 error.

Switching to HTTPS

Hypertext transportation protocol unafraid (HTTPS) provides a level of encryption betwixt servers. You should truthful redirect HTTP webpages to their HTTPS counterparts for accrued security.

This is due to the fact that browsers spot HTTP and HTTPS URLs arsenic unique. Even for the aforesaid page.

For example, if you benignant http://backlinko.com into your browser, that URL automatically redirects you to https://backlinko.com. This makes definite you’re ever utilizing the unafraid mentation of the site.

HTTP redirect

Google besides prefers the HTTPS versions of your webpages.

Changing URLs (Permalinks)

If you alteration your site’s URL operation (or permalinks), you’ll request to acceptable up redirects from the aged URLs to the caller pages.

Let’s accidental your aged URL is www.yourwebsite.com/category/page?id=123, and you privation to alteration that to www.yourwebsite.com/new-page.

You’ll request to adhd a redirect from the aged URL to automatically nonstop visitors to the caller one.

How Redirects Impact SEO

Redirects tin negatively interaction your SEO if you don’t instrumentality them correctly. Poor implementation tin pb to breached links, nonaccomplishment of leafage authority, and decreased rankings.

But erstwhile you usage them correctly, redirects tin payment your SEO successful galore ways:

1. Preserve Link Equity

Link equity, sometimes called “link juice,” is simply a mode of describing the worth a webpage gains from backlinks. When you acceptable up redirects correctly, astir of the nexus equity from the aged URL should transportation to the caller URL.

Link equity

This helps sphere your page’s rankings and wide website authority.

2. Help Search Engines Understand Site Structure

Redirects assistance usher hunt motor bots to the close pages. They assistance them recognize your site’s structure. And marque it easier for them to scale and fertile your astir up-to-date content.

So they don’t discarded clip crawling outdated oregon non-existent pages. Making amended usage retired of your site’s crawl budget.

3. Improve User Experience

Redirects besides assistance visitors find the close pages connected your site. This prevents them from hitting dormant ends oregon seeing aged contented erstwhile they click your links. Providing a amended wide experience.

When users person a bully experience, they’re much apt to enactment longer (and perchance travel backmost to your tract successful the future). This tin assistance your SEO arsenic Google looks to reward contented that provides a bully leafage experience. Meaning you whitethorn spot higher rankings.

However, redirects tin impact your page speed. Which mightiness make a noticeable lag for users (although this is not ever the case). Potentially starring to a mediocre idiosyncratic acquisition aft all.

So it’s a bully thought to cheque your tract velocity aft implementing redirects to marque definite everything’s moving smoothly. You tin usage a escaped instrumentality similar PageSpeed Insights to bash this.

PageSpeed Insights – Backlinko

Types of Redirects

There are 2 main categories of redirects:

  1. Server-side
  2. Client-side

Let’s instrumentality a person look astatine each 1 truthful you tin recognize which ones to use.

1. Server-Side Redirects

Server-side redirects are acceptable up connected the server that hosts your website.

There are galore types of server-side redirects. The astir communal are:

  • 301 Permanent Redirects
  • 302 Temporary Redirects
  • 303 Temporary Redirects
  • 307 Temporary Redirects
  • 308 Permanent Redirects

The 2 you’ll astir apt beryllium utilizing for SEO purposes are 301 and 302 redirects.

301 Permanent Redirects

Use 301 redirects for pages you person moved permanently.

For example, Backlinko utilized to person a backlinks usher leafage astatine https://backlinko.com/backlinks-guide.

Backlinko – Backlinks Guide – Archive

We’ve since updated that page. And incorporated it into our hub connected the topic.

Backlinko – Hub – SEO – Backlinks

With that change, the URL besides changed to https://backlinko.com/hub/seo/backlinks.

And due to the fact that we utilized a 301 imperishable redirect, Google understands that’s the URL we privation to beryllium indexed.

And that’s precisely the leafage that ranks connected Google.

Google SERP – What are backlinks

Using 301 redirects helps guarantee that the ranking powerfulness from the aged URL gets transferred to the caller one.

302 Temporary Redirects

Use a 302 redirect for pages that person been temporarily moved to a caller URL. Such arsenic during income campaigns. Or erstwhile you request to temporarily halt entree to your tract for maintenance.

With a 302 redirect, users are redirected to the caller page, but hunt engines (generally) bash not update their scale to the caller URL. At slightest successful the abbreviated term.

The archetypal URL truthful (usually) retains its ranking power.

However, Google’s indexing pipeline inactive uses 302 redirects arsenic a “weak” awesome that the people URL is canonical (i.e., the 1 you privation Google to index). So, arsenic with immoderate benignant of redirect, usage 302 redirects carefully.

307, 308, and 303 Redirects

These types of redirects are little communal for SEO purposes.

Google considers 307 arsenic equivalent to 302. And 308 arsenic equivalent to 301. You mightiness usage 303 redirects to forestall resubmission of signifier information erstwhile a idiosyncratic clicks refresh oregon the backmost button.

Google Search Central – Redirects – URL indexing

2. Client-Side Redirects

A client-side redirect is added to your webpage alternatively than your server. They’re easier to acceptable up than server-side redirects. And are useful for things similar website maintenance, A/B testing, oregon seasonal promotions.

But they person immoderate drawbacks, including:

  • Slower loading times, which tin frustrate users
  • Less reliability due to the fact that immoderate radical crook disconnected JavaScript successful their browsers (which immoderate client-side redirects trust on)
  • Higher information hazard arsenic hackers tin much easy manipulate them

The 2 communal types of client-side redirects are:

Meta-Refresh Redirects

The meta refresh redirect is an HTML constituent that instructs the browser to refresh the leafage aft a specified fig of seconds. And past redirects to a antithetic URL.

They’re often utilized for elemental redirects. But they tin origin a flimsy delay. And a mediocre idiosyncratic experience.

You spot meta refresh redirects successful the <head> conception of your page. And they look similar this:

<meta http-equiv="refresh" content="3; url=https://www.yourwebsite.com/new-page">

In this example, the redirect would trigger aft 3 seconds.

JavaScript Redirects

A JavaScript redirect adds a publication wrong your HTML. Which means if the hunt motor doesn’t render JavaScript, it won’t find the redirect.

If you bash request to usage JS redirects, spot the JavaScript codification wrong <script> tags, typically successful the <head> oregon <body> sections of your HTML. It mightiness look thing similar this:

<script type="text/javascript"> window.location.href = "https://www.yourwebsite.com/new-page"; </script>

How to Implement Redirects

Implementing effectual redirects tin scope from elemental leafage updates to analyzable site-wide changes. Each requiring a antithetic strategy and level of effort.

For example, if you update oregon consolidate a mates of pages, the process is mostly straightforward. You’ll lone request redirects for those circumstantial URLs. And you mightiness beryllium capable to bash this wrong minutes.

But if you’re making site-wide changes. Such arsenic changing your domain oregon wholly restructuring your website, you’ll request a broad redirect plan.

Regardless of the standard of your planned redirects, enactment organized by listing each your redirects successful a spreadsheet. Like the 1 below.

This gives you a clear, broad record. Making it easier to instrumentality the close redirects. And marque immoderate indispensable changes aboriginal down the enactment without causing further issues.

Redirects – Monitoring table

Once you’ve enactment unneurotic a database of your planned redirects, it’s clip to instrumentality them. We’ll amusement you however to bash this utilizing 2 methods:

  1. Using a WordPress plugin
  2. Editing your .htaccess file

Setting Up SEO Redirects connected WordPress

One of the easiest ways to negociate redirects successful WordPress is by utilizing a plugin similar the 301 Redirects Plugin.

This simplifies the process, particularly if you’re uncomfortable editing server files directly.

Once you person installed and activated the plugin, spell to “Settings” > “301 Redirects” successful your dashboard.

Wordpress – Plugins – 301 Redirects

Set up your redirects here, with options to usage a 301, 302, oregon 307 redirect. Simply take the benignant of redirect you privation to use, the URL you privation to redirect, and the people (new) URL.

Then click “Save.”

301 Redirects – Backlinko.com

There are assorted different plugins that connection redirect capabilities. But if you’re comfy editing your site’s files directly, you tin usage your .htaccess record instead.

Setting Up Redirects connected .htaccess

The .htaccess record is simply a peculiar record utilized by websites moving connected Apache servers. It gives you power of important website settings.

You tin entree the .htaccess record utilizing your hosting provider’s record manager tool.

Here’s how:

First, log into your hosting account. And find a folder labeled “File Manager” oregon similar.

cPanel – File Manager

This volition instrumentality you to each the files hosted connected your server.

cPanel – File Manager – Files

Next, find oregon make the .htaccess files. This is typically located successful the basal directory wherever your website’s files are stored. Often named “public_html” oregon “www.”

Look for a record named “.htaccess” (note the starring period).

File Manager – .htaccess file

If you can’t find it, make a caller record with this nonstop name.

File Manager – Create .htaccess file

Open your .htaccess record successful a substance exertion similar Notepad++ oregon Sublime Text.

Before adding a redirect, alteration the RewriteEngine module. Which allows you to usage URL rewriting rules.

To bash this, adhd the pursuing codification astatine the apical of your .htaccess file:

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

If RewriteEngine On is already present, you don’t request to adhd it again. Go consecutive to the adjacent steps.

Then, adhd the redirect rules beneath “RewriteEngine On” and earlier “</IfModule>.”

The circumstantial codification you adhd volition beryllium connected the benignant of redirect you need. And you whitethorn request to tweak parts of the rules beneath to suit your circumstantial situation. Such arsenic if you privation them to use to each postulation oregon lone circumstantial subdomains.

Redirect One Page

When you lone request to redirect 1 page, adhd the following:

Redirect 301 /old-page https://www.yourdomain.com/new-page

Redirect an Entire Directory Within Your Current Domain

To redirect an full directory, adhd the code:

RewriteRule ^old-directory/(.*) /new-directory/$1 [R=301,L]

This ensures each leafage successful the aged directory corresponds to the applicable pages successful the caller directory.

Redirect to Another Domain

When redirecting postulation from your existent domain to a caller domain, adhd the following:

RewriteCond %{HTTP_HOST} ^olddomain.com$ [NC] RewriteRule ^(.*)$ https://newdomain.com/$1 [L,R=301]

This redirect regularisation redirects each idiosyncratic leafage connected the aged domain to the corresponding leafage connected the caller domain.

Redirect HTTP to HTTPS

Add the codification beneath for HTTP to HTTPS redirects:

RewriteCond %{HTTPS} off RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

It’s worthy noting that galore web hosts volition redirect your pages from HTTP to HTTPS for you. Without the request to edit your .htaccess file.

If editing your .htaccess record manually seems daunting, usage Aleyda Solis’ .htaccess Redirects Generator to minimize the hazard of errors and simplify the setup process.

Aleyda Solis Htaccess Redirects Generator – Homepage

Best Practices for SEO-Friendly Redirects

1. Redirect to Relevant and Similar Pages

Send users to the astir applicable and akin contented available, pursuing these guidelines:

  • If the contented from an aged leafage exists elsewhere, redirect straight to that page
  • For duplicate pages, redirect to the main, authoritative version
  • If a leafage is outdated oregon being replaced, redirect to a caller leafage with updated information
  • If the contented is wholly irrelevant oregon there’s nary suitable replacement, delete the leafage and service a 404 mistake message

2. Avoid Redirect Chains and Loops

Redirect chains hap erstwhile 1 URL redirects to different URL. Which past redirects again. Creating a chain.

Redirect chain

Redirect loops are erstwhile 1 leafage redirects to different page. And past redirects backmost to the archetypal page. Creating an endless loop.

Redirect loop

Both issues tin confuse hunt engines. Leading to crawling inefficiencies and imaginable nonaccomplishment of leafage authority.

While Googlebot tin travel up to 10 redirect hops, it’s champion to nexus straight to the caller leafage whenever possible. Redirects with less hops marque the process faster for some users and hunt engines. And they besides minimize issues specified arsenic breached links if 1 of the redirects fails.

3. Don’t Link to Pages with Redirects

Avoid linking to redirected pages. This tin make unnecessary redirects. Slow down your site. And confuse some users and hunt engines.

Instead, update your internal links to constituent straight to the last destination page.

4. Avoid Soft 404s

Soft 404s are erstwhile you redirect to a leafage that is not applicable to the archetypal page.

GSC – Soft 404 indexing error

An illustration is redirecting a merchandise leafage that nary longer exists backmost to your homepage. This is confusing for some users and hunt engines.

If you can’t find a applicable leafage to redirect to, either permission it arsenic a 404 oregon make a new, applicable leafage that actually helps the user and meets their search intent.

5. Keep Redirects for astatine Least One Year

Google’s existent guidelines urge keeping redirects for astatine slightest 1 twelvemonth aft migrating your website (but the guidance applies to each redirects). This gives users and hunt engines capable clip to observe and accommodate to the changes.

Leaving redirects for this agelong gives Google capable clip to crawl the tract and transportation authorization from the aged leafage to the caller one.

It besides allows different websites to update their links to the caller page.

But, arsenic Gary Illyes of Google has said, it’s champion to support them indefinitely if you can.

X – Gary Illyes – Post

6. Test and Monitor

Monitor your redirects regularly to verify that they’re functioning properly. And are not causing immoderate issues.

Here are 3 ways you tin bash this:

Manual Testing

If you’ve lone redirected a fewer pages, manually participate the aged URLs successful your browser and verify they redirect to the caller URLs.

Alternatively, usage a browser hold specified arsenic Redirect Path (for Chrome). Or the HTTP Status Code Checker tool.

Automated Tools

For much extended redirects, usage SEO tools similar the Screaming Frog SEO Spider oregon Semrush Site Audit.

These tools tin crawl your site, place redirects, and study immoderate errors with them.

For example, successful the Semrush Site Audit tool, you tin hunt for issues related to redirects. And person guidance connected however to hole them.

Semrush – Site Audit – Redirect

To effort it for yourself, use this nexus to get a 14-day escaped trial of a Semrush Pro subscription.

Monitor Redirects with a Spreadsheet

The Redirectinator is simply a escaped spreadsheet created by Jeff Louella of The Tech SEO. It automatically monitors your redirects. To verify that you person implemented them correctly.

The Tech SEO – Homepage

7. Update Internal Links and Sitemaps

For hunt engines, redirects are suggestions. Not directives. That means hunt engines tin take whether oregon not to dainty the redirected URL arsenic canonical based connected each the signals they person astir that URL.

In different words:

Make that URL the superior 1 for indexing and ranking purposes.

To summation the chances of hunt engines doing this for your redirected URLs:

  • Update each interior links to constituent to the caller URLs
  • Update your sitemap to bespeak the caller structure

These steps assistance debar sending mixed signals to Google. By being consistent, you’re making it easier for hunt engines to recognize and travel your redirects.

Watch John Mueller speech astir redirects arsenic signals for canonicalization below:

Set Up Effective Redirects and Boost Your Rankings

Effective redirect absorption isn’t conscionable a nice-to-have. It’s a indispensable for:

  • Preserving nexus equity
  • Boosting idiosyncratic experience
  • Optimizing your tract for hunt engines

For an casual mode to find pages connected your tract that mightiness request redirects, cheque retired our usher to finding (and fixing) breached links.