March 23, 2023

Table of Contents

What Is a 301 Redirect?

A 301 redirect is an HTTP standing code that redirects customers (and engines like google) from one web page to a different. It signifies {that a} web page has moved completely. And passes rating energy from the outdated URL to the brand new one. 

For instance: 

We up to date a weblog publish and redirected it to a brand new URL. 

From https://www.semrush.com/weblog/wordpress-seo-checklist-20-tips/ to https://www.semrush.com/weblog/wordpress-seo/. 

(For those who click on on the outdated URL, you’ll be robotically redirected to the brand new web page). 

We did so as a result of we needed the web page to observe URL finest practices. 

However that’s removed from the one motive to make use of a 301 redirect. 

When Ought to You Use a 301 Redirect?

There are various kinds of redirects (301, 302, meta refresh, and so on.). And every has its personal particular use case. 

Right here’s when (and why) it is best to use a 301 redirect versus one other sort.

Completely Shifting a Web page to a New URL

For instance, from https://www.web site.com/old-page-name/ to https://www.web site.com/new-page-name/.

Typically, it is advisable change the URL of a web page in your web site.

Possibly a product title has modified barely and it is advisable replace the URL. Or wish to higher categorize your web site’s pages. The explanations are countless. 

Implementing a 301 redirect will be sure that customers and engines like google are redirected to the brand new URL. And assist engines like google go the search engine marketing energy of the outdated URL to the brand new URL. 

Deleting a Web page

If, for any motive, you wish to delete a web page in your web site, it is best to redirect it to a different related web page if in any respect doable. 

Why?

It creates a greater person expertise. And offers individuals another. 

For instance, for those who merely delete the web page, customers who click on on a hyperlink to the web page in search or on one other webpage will land on a web page like this:

404 error on a page

With out another, the person will possible bounce. 

Your finest wager, usually, is to make use of a 301 redirect to ship the person to an analogous web page in your web site.

Migrating Your Web site to a New Area

For instance, from https://www.web site.com to https://www.newwebsite.com.

You might also wish to migrate your web site to a brand new area fully. 

Say you’re migrating from a .web to a .com. Or possibly you’ve rebranded and want to maneuver to a unique area title.

A 301 redirect is the easiest way to do this. And notify Google utilizing Google Search Console’s Change of Address instrument.

Altering Your Web site Construction

For instance, from https://www.web site.com/old-category/publish/ to https://www.web site.com/new-category/publish/.

If you wish to change your web site’s construction to make it simpler to prepare your content material and for Google to grasp how your pages are associated, go for 301 redirects. 

The identical applies to altering any subfolder construction in your web site. 

Whether or not that’s weblog classes, ecommerce classes, or different folders. A everlasting redirect is the easiest way to implement the change. 

Shifting From Non-WWW to WWW URLs (or Resolving Duplication Points)

For instance, from https://www.web site.com to https://web site.com.

It’s essential to be certain that the principle model of your web site is both non-www or www. 

Doing so will make your web site seem extra constant to customers and engines like google. And keep away from duplication points. 

One of the simplest ways to make this clear is to make use of a 301 redirect to point which is the principle model. And redirect customers and engines like google to your most popular model. 

Switching From HTTP to HTTPS

For instance, from http://www.web site.com to https://www.web site.com. 

If you wish to change from HTTP to HTTPS (as a result of it’s safer and certainly one of Google’s rating indicators), use a 301 redirect. 

Doing so will guarantee Google correctly indexes the brand new protocol. And that customers are redirected to the best pages. 

Merging Two (or Extra) Domains

For instance, from https://www.web site.de to https://www.web site.com/de/.

Typically, corporations might want to merge one area with one other. That is frequent after enterprise mergers and acquisitions. 

This course of requires exhaustive planning. However, for simplicity’s sake, if we’re speaking about merging, the way in which to maintain as a lot search engine marketing energy as doable is to merge utilizing a 301 redirect. 

Resolving ‘Trailing Slash’ Points

For instance, from https://www.web site.com/page-name to https://www.web site.com/page-name/.

Variants of a URL with and with no trailing slash are literally completely different pages. And Google will see them that means. 

It’s essential to be certain that your web site makes use of a constant method to dealing with trailing slashes on web page URLs. The right means to do that is to 301 redirect one to the opposite. 

Resolving Higher-Case vs. Decrease-Case Points

For instance from https://www.web site.com/Web page-Title/ to https://www.web site.com/page-name/.

Simply as with trailing slashes, upper- and lower-case URLs will be thought-about completely different pages. 

Even one capitalized letter in a URL could make it completely different from its lower-case counterpart. And engines like google may even see it as a reproduction.

Utilizing 301 redirects is normally the easiest way to resolve these points.

Word: Typically talking, it is smart to make use of lower-case to your URLs and to not combine upper-case and lower-case. 

How you can Do a 301 Redirect

The way in which you implement a 301 redirect relies on your server and the content material administration system (CMS) you employ. 

Right here’s do a 301 redirect throughout a number of the frequent setups.

301 Redirects on WordPress Websites

Implementing WordPress redirects is comparatively easy and easy, in comparison with different obtainable redirect strategies. In case you have a WordPress web site, think about using a plugin earlier than making an attempt any of the opposite redirect strategies on this listing.

For those who’re utilizing the Yoast SEO Premium plugin, you’ll discover a built-in redirects supervisor you should use to implement redirects. 

adding redirect with Yoast SEO Premium plugin

For those who’re utilizing the free model or one other plugin that does not provide redirects, you’ll want to put in a devoted redirects plugin. 

Redirection is among the many hottest redirect managers for WordPress. You may add your redirects in minutes. 

Like so:

adding redirect with Redirection

For those who’re utilizing another like Rank Math, you will discover a redirect supervisor included throughout the plugin.

adding redirect with Rank Math

301 Redirects on Shopify Shops

As with WordPress, implementing 301 redirects on a Shopify retailer is comparatively easy and easy.

To take action, head to Gross sales channels > On-line Retailer > Navigation

Shopify Store navigation

You’ll see a discreet “View URL redirects” hyperlink within the top-right nook. Go forward and click on it.

View URL redirects highlighted

Subsequent, click on “Create URL redirect.”

It’s then so simple as including your “from” and “to” URLs and saving the redirect. 

add and save redirect page

301 Redirects on BigCommerce

For those who’re working a retailer on BigCommerce, right here is add 301 redirects:

Navigate to Settings › 301 Redirects.

And add a redirect, together with your outdated URL.

add redirects on BigCommerce

Select a handbook hyperlink, the place you enter the brand new URL to redirect to. 

Or dynamic hyperlink, the place you choose a web page or class, and the redirect will robotically replace for those who change this web page later.

choose manual or dynamic url

Enter your new web page’s URL or select a web page to redirect to for those who chosen the dynamic hyperlink possibility above.

add new page's URL

301 Redirects on Magento Shops

In case your ecommerce retailer runs on Magento, the performance so as to add 301 redirects is constructed proper into the platform.

Right here is create them:

Magento 1

If you’re working Magento 1, navigate to Catalog > URL Rewrite Administration

URL Rewrite Management

You’ll see any redirects which have beforehand been created.

Go forward and “Create URL Rewrite.”

And choose “Customized” rewrite.

Custom rewrite

Then, fill out the required URL rewrite info.

Like so:

fill out the required URL rewrite information

ID Path = The title of your rewrite that is used for admin functions solely.

Request Path = The unique / from URL

Goal Path = The brand new / goal URL

Redirect = Everlasting (301)

Description = Any description you wish to add for the redirect

Magento 2

For Magento 2, first navigate to “URL Rewrites”:

Advertising > search engine marketing & Search > URL Rewrites

how to navigate to URL Rewrites

Go forward and “Add URL Rewrite” and fill out the required info.

Like this:

ill out the required URL rewrite information

Create URL Rewrite: Customized

Retailer = The shop you wish to add the redirect for

Request Path = The unique / from URL

Goal Path = The brand new / goal URL

Redirect Sort = Everlasting (301)

Description = Any description you wish to add for the redirect

301 Redirects on Apache Servers

Warning: This 301 redirect technique is just meant for specialists. Errors right here may cause massive issues to your web site. For those who’re not an professional, proceed with excessive warning or attain out to an professional who will help.

In case your web site runs on an Apache server, you may edit your web site’s .htaccess file to implement redirects.

So as to add a redirect to the file, add a line that tells the server what to do. You’ll add your new guidelines instantly beneath “RewriteEngine On,” which you will discover within the mod_rewrite module in Apache.

When you’ve positioned the best place so as to add a brand new rule, use the next examples to do the next:

Redirect a Single Web page

RRedirect 301 /oldpage/ https://www.instance.com/newpage/

Redirect an Total Area to One other

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

Redirect an Total Web site to a Subfolder

Redirect 301 / https://www.web site.com/subfolder/

Redirect a Subfolder to a Totally different Area

Redirect 301 /subfolder https://www.newwebsite.com/

Redirect a Web site Listing After a URL Change

Choices +FollowSymLinks RewriteEngine On RewriteRule 
^(.*)/old-category/(.*)$ $1/new-category/$2 [R,L]

Redirect From Non-WWW to WWW

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

Redirect From HTTP to HTTPS

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

Redirect to Trailing-Slash URLs

RewriteCond %REQUEST_FILENAME !-f 
RewriteCond %REQUEST_URI !(.*)/$ 
RewriteRule ^(.*)$ http://www.web site.com/$1/ [R=301,L]

301 Redirects on Nginx 

Warning: This 301 redirect technique is just meant for specialists. Errors right here may cause massive issues to your web site. For those who’re not an professional, proceed with excessive warning or attain out to an professional who will help.

To create a everlasting 301 redirect on Nginx, it is advisable add a line to your .conf file that’s usually discovered within the root of your server. 

A few of the frequent traces you may want to make use of are as follows:

Redirect a Single Web page

server 
# Everlasting redirect to an particular person web page
rewrite ^/old-page$ http://www.web site.com/new-page everlasting;

Redirect an Total Area to One other

server 
    pay attention 80;
    pay attention 443 ssl;
    server_name devisers.in www.devisers.in;
    return 301 $scheme://www.devisers.com$request_uri;

Redirect from HTTP to HTTPS

server 
pay attention 80;
server_name web site.com www.web site.com;
return 301 https://web site.com$request_uri;

Redirect From Non-WWW to WWW

server 
    pay attention 80;
    pay attention 443 ssl;
    server_name devisers.in;
    return 301 $scheme://www.devisers.in$request_uri;

301 Redirects on a Home windows Server 

Warning: This 301 redirect technique is just meant for specialists. Errors right here may cause massive issues to your web site. For those who’re not an professional, proceed with excessive warning or attain out to an professional who will help.

In case your web site runs on a Home windows server in ASP.NET, it is advisable add redirects into the online.config file within the web site root.

Right here’s implement the commonest 301 redirections:

Redirect a Single Web page

<configuration>
<location path="old-page">
<system.webServer>
<httpRedirect enabled="true" vacation spot="http://www.web site.com/new-page/" httpResponseStatus="Everlasting" />
</system.webServer>
</location>
</configuration>

Redirect An Total Area to One other

<system.webServer>
<httpRedirect enabled="true" vacation spot="http://www.newwebsite.com/" />
</system.webServer>

Redirect from HTTP to HTTPS

<configuration>
<system.webServer>
<rewrite>
<guidelines>
<rule title="HTTP to HTTPS redirect" stopProcessing="true"> 
<match url="(.*)" /> 
<circumstances> 
<add enter="HTTPS" sample="off" ignoreCase="true" />
</circumstances> 
<motion sort="Redirect" redirectType="Everlasting" url="https://HTTP_HOST/R:1" />
</rule> 
</guidelines>
</rewrite>
</system.webServer>
</configuration>

Redirect from Non-WWW to WWW

<rewrite>
<guidelines>
<rule title="Redirect http://web site.com to http://www.web site.com HTTP" patternSyntax="ECMAScript" stopProcessing="true">
<match url=".*"></match>
<circumstances>
<add enter="HTTP_HOST" sample="^web site.com$"></add>
<add enter="HTTPS" sample="off"></add>
</circumstances>
<motion sort="Redirect" url="http://www.web site.com/R:0" redirectType="Everlasting" appendQueryString="true"></motion>
</rule>
</guidelines>
</rewrite> 

How you can Use 301 Redirects to Enhance Your search engine marketing Efficiency

301 redirects will help you overcome points that maintain again your web site’s natural visibility. Or take advantage of out of alternatives to drive progress. 

Listed here are a number of the most typical methods 301s can be utilized to spice up your search engine marketing efficiency:

Merge or Redirect Skinny Content material Pages 

One of the vital impactful methods to make use of 301 redirects is to make use of them as a part of a content material pruning job—merging skinny content material pages collectively to create items that cowl a subject in additional depth.

First, determine pages with little or no visitors, backlinks, social shares, and so on. 

You are able to do that simply with Semrush’s Content material Audit instrument. For this technique particularly, give attention to the “Poor content material” group. 

Poor content box in content audit tool

Then, redirect these pages to others that serve the identical intent. Or merge them collectively to create one thing of higher high quality. And redirect to the brand new piece. 

Migrate Your Weblog From a Subdomain to a Subfolder

This is likely one of the most typical methods to make use of 301 redirects for fast search engine marketing wins.

A subdomain is sort of a little one of the father or mother area. And is commonly used to host blogs and shops. 

For instance, weblog.yourdomain.com 

And a subfolder is a part of your most important area. Like every other web page. 

For instance, yourdomain.com/weblog/

The factor is: 

Google can deal with your subdomain as a separate entity out of your most important area. 

Which suggests Google may not consider all the precious content material in your subdomain and its invaluable property (like backlinks) when evaluating your main area. 

So, that will help you doubtlessly rank higher and drive extra visitors, it would make sense to redirect your weblog from a subdomain to a subfolder. 

Word: Each web site is completely different, so don’t redirect a subdomain to a subfolder with out first doing all of your analysis to guarantee that can be a helpful transfer.

Resolve Key phrase Cannibalization Points

Key phrase cannibalization is when two (or extra) pages are displaying up in Google for a similar or extremely comparable key phrases and competing towards one another. Google doesn’t know which pages ought to rank greater for which key phrases.

You don’t need that. 

And the only technique to repair cannibalization points is commonly to redirect the lowest-performing web page to the opposite. 

By low-performing, we imply the one with fewer backlinks, decrease rating, decrease visitors, and so on. 

You may shortly discover cannibalization points utilizing Semrush’s Place Monitoring instrument. Below the cannibalization tab. 

Cannibalization in position tracking tool

Merge A number of Web sites Into One

Typically companies run on a number of websites.

As an example you run a lodge chain and have a unique web site for every lodge. It’d make sense to merge these all into one.

Similar to Marriott does. 

Merge multiple websites into one

Once more, the purpose is to mix the authority and fairness of a number of area properties into one, leading to a stronger web site that drives fast wins. 

Word: This answer could not work in the identical means for each web site or enterprise. Do your individual analysis earlier than shifting ahead with a website-merging or redirecting venture.

Frequent 301 Redirect Errors & How you can Keep away from Them

Right here’s discover and repair the commonest points with 301 redirects. 

Permitting Pages to 404

Don’t let pages return a 404 error for those who can fairly keep away from it. It creates a horrible person expertise and might harm your search engine marketing efficiency. 

To keep away from working into this difficulty, run an audit in your web site each month. 

For those who use Semrush’s Web site Audit, you’ll see pages returning a 4XX standing code beneath the “Points” tab. 

pages returning a 4XX status code

Redirect all 404 pages to different pages which are associated and/or serve the identical or an analogous objective. 

Utilizing 302 As an alternative of 301 Redirects

A typical difficulty amongst SEOs shouldn’t be understanding whether or not it is best to apply the 301 redirect vs. 302. 

301 redirects needs to be used when the change is everlasting. And 302s when the change is just short-term.

Once more, Web site Audit will help you discover these. You’ll see them as “URLs with a brief redirect.”

URLs with a temporary redirect

Until they’re actually short-term, replace these redirects to 301s. 

Utilizing JavaScript for Redirection With no Correct Setup

301 redirects are server-side. And JavaScript redirects are client-side. That means they inform the browser to get the content material from a unique location. 

You may wish to use JavaScript for redirects for those who don’t have entry to your server configuration or .htaccess file, are working an A/B take a look at, or produce other particular wants. 

However do word that they aren’t the optimum selection. 

Engines like google have to render a web page to seek out the redirect. And if, for instance, Google can’t crawl a web site’s JS file, the web page can’t be rendered. 

Utilizing a 301, 302, or 307 redirect as an alternative of a JavaScript redirect is often really useful to keep away from any points.

It may be tempting to repair damaged inside hyperlinks by redirecting the hyperlink to a different web page. However over time, this may create one other difficulty: a redirect chain. (Extra on that later.)

As an alternative, replace the goal of the damaged hyperlink first. Then, and solely then, add a redirect to the right web page. 

You could find damaged inside hyperlinks in Web site Audit, beneath the “Points” tab. 

broken internal links

Redirect Chains & Loops

A redirect chain occurs when there are two or extra redirects between the primary URL and the ultimate URL. 

And a redirect loop is when a URL is redirected to a different, which in flip redirects again to the preliminary URL. Resulting in an infinite loop of redirects. 

Each of those points are detrimental to your web site’s person expertise and, doubtlessly, your search engine marketing efficiency. 

To repair them, first discover any chains and loops. Then, change the inner hyperlinks to redirected pages with hyperlinks to the ultimate URL. And replace current redirects to level on to the ultimate, most present URL.

Once more, you may simply discover redirect chains and loops in Web site Audit, beneath the “Points” tab. 

Like so:

Redirect chains and loops

301 Redirects and Technical search engine marketing

Discovering and fixing 301 redirect points is simply one of many many steps to enhance your technical search engine marketing. 

Take a look at these sources to be taught extra about technical search engine marketing: