Redirects: What They Are & How to Use Them

10 months ago 86
ARTICLE AD BOX

What Is a Redirect?

A URL redirect (sometimes called “URL forwarding”) is simply a mode to nonstop users and hunt engines to a antithetic URL than the 1 they requested.

Redirects are utilized to determination a webpage to a caller address, ensuring that visitors and hunt engines are automatically taken to the close page.

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

Why Are Redirects Important?

Redirects are important for a fewer main reasons:

Redirects Ensure a Good User Experience

Redirects guarantee visitors don’t onshore connected breached oregon duplicate pages connected your site. 

Here’s an example: 

Let’s accidental you wrote a blog station astir the champion play courses successful Michigan successful 2024. And the URL was “yourgreatsite.com/blog/best-golf-courses-in-michigan-2024.”

If you determine to update the station successful 2025, you astir apt privation to delete the twelvemonth and people the updated station nether “yourgreatsite.com/blog/best-golf-courses-in-michigan.”

This makes the aged URL nary longer accessible.

But radical who work it earlier the alteration mightiness person the aged URL saved successful their bookmarks. Or they mightiness person shared it determination connected societal media. And that aged URL mightiness inactive amusement up connected search motor effect pages (SERPs) for a while.

If users effort to click connected that URL and it hasn’t been redirected to the caller one, they’ll person a 404 mistake effect from the server.

Like this:

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

This isn’t large for the user’s experience—those visitors are apt to leave. Which is wherefore you should usage redirects to debar the issue.

That said, see whether the erstwhile leafage genuinely has an equivalent that’s worthy redirecting your users to. If there’s nary applicable replacement, past it’s amended to acceptable up an informative 404 page. 

Redirects Can Preserve Search Performance

Redirects tin transportation ranking authorization from an aged leafage to the newer mentation (or assistance it stay successful spot erstwhile the determination is temporary). To support rankings and traffic.

Using the aforesaid illustration from above, let’s accidental your archetypal nonfiction (“yourgreatsite.com/blog/best-golf-courses-in-michigan-2024”) had acquired hundreds of backlinks and was driving thousands of visits from hunt results each month.

By utilizing a redirect, that worth tin beryllium transferred to the updated version.

When to Use Redirects

Sites typically redirects successful these situations:

  • Moving the URL of a webpage (from URL A to URL B)
  • Deleting a page
  • Adding class tags oregon genitor pages that impact URLs
  • Migrating a website to a caller domain
  • Tweaking URL naming conventions
  • Merging 2 oregon much duplicate webpages
  • Switching a tract from HTTP to HTTPS

You tin use a web redirect to a azygous URL, to a radical of URLs, oregon an full domain.

Types of Redirects

There are 2 main types of redirects: permanent and temporary

Users won’t beryllium capable to archer the difference, but the favoritism is important for hunt engines. 

Permanent redirects are for erstwhile you don’t expect to show the aged leafage again. (e.g., if you harvester duplicate pages). Permanent redirects archer hunt engines it’s OK to region the aged URL from hunt results and commencement displaying the caller one

Temporary redirects are for erstwhile you request to redirect a webpage for a constricted magnitude of time. (e.g., you’re performing website attraction and privation to show a connection telling users to cheque backmost later). 

Now, let’s look astatine the main redirect types:

HTTP Redirects

HTTP redirects usage a peculiar codification successful the HTTP effect to archer the browser to spell to a antithetic webpage. 

Here’s however this process works: 

The user’s browser requests the aged (redirected) URL. And the server automatically displays the webpage for the caller URL (the redirect target).

From the user’s constituent of view, HTTP redirects are wholly seamless.

In method terms, these are called server-side redirects. Because your web server (where your website is hosted) takes attraction of it before your website adjacent loads.

It does that by responding with a 3xx HTTP codification erstwhile it receives the petition for the redirected URL.

Those 3xx codes are similar instructions for your browser. They bespeak that the requested URL has been redirected. And uncover wherever to find the caller webpage (the redirect target).

Here are the astir communal types of 3xx codes:

301 Redirects (Moved Permanently)

301 redirects archer hunt engines similar Google that the determination from 1 URL to different is permanent. 

They’re besides considered the champion mode to walk nexus equity if you request to redirect a page. That’s due to the fact that they walk ranking spot from the aged URL to the caller one.

For example, let’s accidental your tract has 2 pages astir canine toys. There’s nary request for 2 pages astir the aforesaid topic. And 1 of the pages is outdated.

old leafage   redirects to caller   leafage   astatine  antithetic  url

In this case, it’s champion to delete the older, outdated leafage and 301 redirect it to the caller page’s URL.

302 Redirects (Found & Moved Temporarily)

302 redirects archer Google that the redirect from 1 URL to different is temporary. 

Use a 302 redirect erstwhile you:

  • Temporarily determination your leafage to a caller URL
  • Need to instrumentality a leafage offline for a abbreviated portion to execute maintenance
  • Want to A/B trial caller website plan oregon copy

Google volition continue to index the redirected page. And nary of its ranking spot volition transportation to the caller page.

Which means:

Using impermanent redirects by mistake could harm your hunt motor rankings. 

Check for issues by moving a speedy tract audit with Site Audit

Head to the “Issues” tab and benignant “redirect” into the hunt bar. You’ll spot the fig of URLs with impermanent redirects. 

Results for "redirect" nether  the "Issues” tab successful  Site Audit

Go done the affected URLs to verify that they should beryllium impermanent redirects. 

You should lone usage a 302 if you program to bring backmost the archetypal URL astatine immoderate point.

That means you’ll privation to code immoderate accidental 302 redirects. By making them imperishable redirects.

Other HTTP Redirects

As acold arsenic server-side redirects go, you usually lone request to usage 301 and 302 redirects. 

But determination besides are immoderate rarer types of HTTP redirects:

  • 303 redirect (see other): Sends users to different applicable leafage erstwhile the aged 1 isn’t disposable (most often erstwhile users person already submitted a signifier and cannot resubmit) 
  • 307 redirect (moved temporarily) and 308 redirect (moved permanently): Similar to some 302 and 301 redirects successful function, these redirects were important for method reasons erstwhile browsers similar Netscape Navigator and erstwhile versions of Internet Explorer were popular. 

Meta Refresh Redirects

Meta refreshes are redirects that hap astatine the leafage level (client side) alternatively than the server level. Unlike HTTP requests. 

If you request to instrumentality redirects, HTTP redirects are typically amended than meta refreshes for SEO. 

Because meta refreshes are slower, perchance hurting your idiosyncratic experience. And they could pb to hunt engines indexing the incorrect page.

Google lone recommends meta refresh redirects if you can’t usage a server-side redirect

There are 2 types of meta refresh redirects: 

Instant Meta Refresh Redirects

Instant meta refresh redirects trigger arsenic soon arsenic the browser loads the page. Google interprets them arsenic imperishable redirects.

They look similar this:

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

Delayed meta refresh redirects 

Delayed meta refresh redirects trigger aft a fig of seconds you choose. Google interprets delayed meta refresh redirects arsenic impermanent redirects.

Here’s an illustration that triggers aft 5 seconds:

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

JavaScript Redirects

Another benignant of client-side redirects are JavaScript redirects are different benignant of client-side redirect. They aren’t recommended for SEO due to the fact that Google mightiness not render the JavaScript connected your page—or tally into errors erstwhile it does.

If that happens, Google doesn’t adjacent announcement your redirect and indexes the redirected leafage arsenic usual. Which could marque an outdated URL amusement up successful hunt results oregon origin a driblet successful your hunt rankings.

That’s wherefore Google explicitly advises against JavaScript redirects:

Google says "only usage  javascript redirects if you can't bash  server-side oregon  meta refresh redirects. portion    google attempts to render each   url googlebot crawled, rendering whitethorn  neglect  for assorted  reasons. this means that if you acceptable   a javascript redirect, google mightiness  ne'er  spot    it if rendering of the contented  failed.

Here’s an illustration of a JavaScript redirect successful your HTML code:

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

How to Implement Redirects

You tin acceptable up HTTP redirects successful a fig of ways. Let’s spell implicit the main ones:

Use WordPress Plugins 

You tin usage plugins similar Yoast to acceptable up redirects connected WordPress.

To commencement the process, archetypal download the Yoast plugin from the WordPress store and activate it. 

Next, prime “Redirects” nether the Yoast menu:

Yoast SEO successful  WordPress toolbar and Redirects highlighted

Choose the benignant of redirect you privation to acceptable up.

Enter the slug (the extremity information of the URL) of the aged redirect URL and the caller URL you privation to redirect to.

Make definite the slugs are spelled correctly. Otherwise, the redirect whitethorn not work.

Click “Add Redirect” and your redirect volition beryllium live.

Use Wix

If you usage Wix, you tin acceptable up redirects straight successful the CMS.

Scroll down to the bottommost of your website power panel. And click connected “SEO” nether “Website & SEO.”

Wix SEO successful  navigation

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

URL Redirect Manager highlighted

Then, deed “+ Create New Redirect” astatine the top.

A pop-up volition appear. Select your benignant of redirect, adhd the aged URL you privation to redirect from, and adhd the URL you privation to redirect to.

Finish by clicking “Save” oregon “Save & Add Another.”

Wix adhd  redirect popular  up

Use an .htaccess File

You tin besides execute redirects manually. With a record called .htaccess.

It’s successful plain substance and looks similar this:

.htaccess record  example

Apache servers usage the .htaccess file. (But these tin beryllium recovered connected different types of servers, too). 

Start by locating the RewriteEngine (which tin beryllium recovered successful the mod_rewrite module successful Apache).

This module should already beryllium successful Apache by default. But you tin besides adhd it utilizing this code:

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

Now, we’ll adhd our rules straight beneath “RewriteEngine On.”

Redirect a Single URL

To redirect 1 URL, usage the codification below. Specify the benignant of redirect and regenerate “/oldpage/” and “/newpage/” with the existent leafage slugs.

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

Redirect a Single Folder

To redirect a folder, usage the pursuing codification and regenerate “folder” with the folder you’d similar to redirect and “location” with wherever you’d similar to redirect the folder.

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

Redirect to Another Domain

To redirect to a caller domain, adhd the pursuing code:

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

Redirect Non-WWW to WWW

If users (or hunt engines) effort to scope URLs without the “www” subdomain, you tin redirect them to the URL that does see it.

Choosing 1 “correct” subdomain helps Google recognize which 1 should beryllium considered canonical.

Add this codification to redirect a non-www URL to a www URL:

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

Redirect WWW to Non-WWW

This is fundamentally the other of the supra scenario. If you don’t privation users to entree the “www” subdomain, you tin adhd this code:

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

Non-www URLs tin beryllium utile for nonstop traffic, arsenic radical usually participate successful URLs without adding “www.” But support successful caput that you person little power implicit cookies with the non-www subdomain.

Redirect HTTP to HTTPS

If you’re looking to redirect HTTP pages to HTTPS pages, usage this code:

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

Keep successful caput that you’ll request to acquisition and instrumentality a unafraid sockets furniture (SSL) certificate earlier redirecting to HTTPS.

5 Redirect Best Practices

We’ve covered however to acceptable up assorted kinds of redirects. So, let’s spell implicit immoderate champion practices:

1. Redirect to Content That’s a Close Match

When you acceptable up a redirect, marque definite the caller page’s contented intimately matches the aged page’s content. And satisfies the aforesaid idiosyncratic intent.

Otherwise, you’re amended disconnected utilizing a 404 page.

Here’s what Google’s John Mueller says connected the topic:

Youtube video thumbnail

If the idiosyncratic clicked connected your tract successful hunt of a knife, they would beryllium frustrated to lone spot spoons. It's a unspeakable user-experience, and doesn't assistance successful search.

Not pursuing this line tin pb to Google treating a leafage arsenic brushed 404.

A brushed 404 usually happens erstwhile the server sends the http presumption code “200 OK.” And the leafage contains a connection specified arsenic “webpage not found.. 

But Google tin dainty a leafage arsenic a brushed 404 if it’s redirected to an irrelevant page. Like successful the illustration Mueller gave above.

You tin find brushed 404s with Google Search Console.

Head implicit to the “Pages” tab nether “Indexing.”

Google Search Console Pages report

Scroll down until you spot the “Why pages aren’t indexed” section. And hunt for “Soft 404” successful the “Reason” column.

soft 404 mistake  highlighted

Once you find the brushed 404 errors, hole them. 

For immoderate brushed 404 related to redirects, update the redirect truthful that it points to the astir applicable leafage available.

2. Avoid Redirect Chains & Loops

A redirect chain is erstwhile much than 1 URL redirect exists betwixt the archetypal URL and the last URL.

Let’s accidental that a page’s URL was antecedently “www.yoursite.com/about-the-company/” earlier it was redirected to “www.yoursite.com/about-us/.” 

If you aboriginal redirect the newer URL to “www.yoursite.com/about/,” that would make a redirect chain.

Because present the archetypal URL redirects to the 2nd URL. And the 2nd URL redirects to the 3rd URL.

Like this:

a redirect concatenation  illustration  shows url a redirects to url b which redirects to url c

Google tin follow up to 10 redirect “hops” without issues. But beryllium cautious of making things excessively complex.

Redirect chains that are excessively agelong tin hold crawling, origin losses successful nexus equity, and summation leafage load time.

Which tin wounded your SEO and frustrate users.

To hole the issue, redirect consecutive from the archetypal URL to the last one. Without including further redirects successful between.

This is what a corrected redirect concatenation looks like:

Corrected redirect concatenation  with some  url a and url b redirecting to url c

A redirect loop occurs erstwhile a URL redirects to different URL. And that 2nd URL redirects backmost to the archetypal URL. This creates an infinite ellipse of redirects.

Like this:

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

This redirection is breached and won’t really guardant visitors oregon hunt engines to the intended destination. 

Fix redirect loops by choosing the “correct” leafage and ensuring the different leafage redirects to it. Then delete the different redirect causing the loop.

You tin usage Site Audit to cheque for redirect chains and loops.

Run an audit and spell to the “Issues” tab and benignant “redirect chain” into the hunt bar.

Click connected the “# redirect chains and loops” contented to get a afloat study of pages with redirect concatenation oregon loop errors.

Redirect chains and loops successful  Site Audit

The study contains a database of pages, their redirect type, and the fig of redirects.

List of leafage   urls with redirect nexus  successful  Site Audit

Log into your CMS and hole each one. 

To sum up, you can:

  • Fix redirect chains by redirecting the aged URL straight to the caller URL. Delete immoderate unnecessary redirects successful between. 
  • Fix redirect loops by choosing the “correct” page. Redirect to the close leafage from the different page. Then delete immoderate different unnecessary redirects causing the loop.

3. Avoid Linking to Redirected Pages

Let’s accidental you redirect an aged leafage to a caller page. You mightiness person different pages connected your tract that inactive nexus to your aged page’s URL.

If so, users volition beryllium sent to your aged link. And past beryllium redirected to the caller URL. 

Users astir apt won’t announcement this. But that other redirect tin lend to a redirect concatenation implicit clip if you don’t retrieve to support it. 

Here’s what the contented looks like:

Linking to a leafage   with a redirect shows blog station  linking internally to an aged  leafage   which redirects to the caller   page

So, it’s champion to alteration aged interior links to your caller page’s URL. 

Which looks similar this:

Avoid linking to a leafage   that redirects to another. the blog station  links internally to the caller   page

But however bash you find links connected your website that constituent to redirects?

It’s simple:

Open Site Audit and caput to the “Crawled Pages” tab.

Site Audit Crawled Pages report

Then, adhd your aged (redirected) URL into the hunt barroom and click the hunt icon.

Add your leafage   to Crawled Pages hunt  bar

Then, you’ll spot a study for your specified URL.

Click connected it.

Crawled Pages study  for 1  redirected URL

You’ll past beryllium capable to spot a database of interior links pointing to your aged URL nether the “Incoming Internal Links” section.

Now, each you person to bash is swap the aged nexus for the caller link. 

4. Redirect to Avoid Duplicate Content

It’s not uncommon to find that a tract exists connected much than 1 subdomain. 

For example, “http://example.com” and “https://example.com” constituent to the aforesaid domain. 

Search engines presumption them arsenic abstracted sites. But this tin origin duplicate content issues if you aren’t careful.

Essentially, you could divided postulation and vie with yourself if Google isn’t definite which mentation of your tract to nonstop users to.

You tin easy resoluteness this contented by 301 redirecting each variants of a leafage to a azygous URL. This volition nonstop Google to your preferred leafage (the redirect target).

Use redirects to forestall duplicate contented successful the pursuing instances:

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

You tin find duplicate contented connected your tract successful the “Issues” tab of the Site Audit tool.

Type “duplicate”into the hunt barroom to get a database of applicable errors. 

Now click connected the “# pages person duplicate contented issues” mistake to get a afloat report.

Pages with duplicate contented  issues

This volition bring up a database of pages that you whitethorn request to redirect. Along with however galore duplicate pages exist.

Page URLs with duplicate contented  issues successful  Site Audit

Click connected the drop-down arrow connected the close broadside of each listing to spot the duplicate pages.

Examples of pages with duplicate content

And redirect each duplicate leafage arsenic needed.

Google ignores backlinks that constituent to a 404 page. And that’s a occupation due to the fact that backlinks are an incredibly important ranking factor.

In different words, you’re not getting immoderate recognition from Google for those backlinks pointing to 404 pages.

Here’s a speedy fix:

Use Backlink Analytics to uncover 404 pages that person links pointing to them. 

Head to the “Indexed Pages.” And tick the container beside “Broken Pages.”

Broken Pages successful  Backlink Analytic's indexed pages report

You’ll get a database of missing URLs that person links pointing to them.

redirect errors successful  breached  indexed pages with interior   links noted

Reclaim immoderate of that mislaid authorization by 301 redirecting those pages to applicable pages that are adjacent matches.

Redirect FAQs

Do Redirects Pass Page Authority?

Permanent redirects walk authorization from the aged leafage to the caller page. If there’s a adjacent lucifer betwixt each page’s content.

But support successful caput that redirects whitethorn not needfully walk 100% of the archetypal page’s authority.

If you person a morganatic crushed to redirect a page, it’s champion signifier to instrumentality the redirect.

Are Redirects Bad for SEO?

No, redirects aren’t inherently atrocious for SEO.

But Google’s line is: 

  • If a leafage is gone and has nary suitable replacement, don’t redirect
  • If a leafage lone moves to a caller location, a redirect makes consciousness and is encouraged

If you service a spoon leafage wherever users antecedently were offered a weapon (the illustration Mueller used), a redirect would beryllium a atrocious idea. And Google mightiness dainty the caller leafage similar a 404 page.

How Long Should You Keep Redirects successful Place?

For Google, you should support 301 redirects successful spot for astatine slightest a year.

Here’s the punctuation by John Mueller from Google wrong a video from Google Search Central.

When a URL changes, our systems request to spot the alteration successful the signifier of a redirect for astatine slightest a fewer times successful bid to grounds that change.To beryllium definite that a redirect has been seen a fewer times, we urge keeping the redirect successful spot for astatine slightest 1 year.

For users, you ideally support them successful spot indefinitely. So radical don’t brushwood errors connected your tract and permission it.

How Do I Test Redirects?

Copy the aged URL and paste it into your browser. If it directs you to the caller URL aft you deed enter, your redirect works.

If not, spot if determination is simply a typo successful the redirect you acceptable up.