5-Minute Tutorial: Discover 301 Redirect Technique for Magento 2 Sites

Top view of Cloud with the word SEO

5-Minute Tutorial: Discover 301 Redirect Technique for Magento 2 Sites

“Why must every merchant do 301 Redirect Magento 2 properly?”

– It is not only about your SEO efforts, but more importantly, your customer experience!

It is common that you change, disable, or remove some products, categories, and contents over time. Without redirection, their URL links on the SERPs or referral sites may result in a 404 Page Not Found error.

Such an entrance experience is annoying and customers no longer want to land on your Magento 2 website. Not to mention, search engine crawlers do not like these broken links and rank your website low!

Here we fix the case with a brief but descriptive tutorial with Magento 2 301 redirect best practices. Check right away!

What Is A 301 Redirect Definition?

Redirect is the act of sending both users and search crawlers to a different URL from the one they originally requested because the original URL is no longer available or useful.

3 types of redirect for eCommerce websites

3 types of redirects: 301 redirect; 302 redirect; meta refresh

However, not all redirect techniques are the same. The web owner can choose among:

  • 301 Moved Permanently– Recommended for SEO.
  • 302, “Found” or “Moved Temporarily”.
  • Meta Refresh.

301 Redirect Definition

In this post, we focus on the definition of 301 Redirect.

Accordingly, 301 redirects are to permanently send search engines and visitors to the new destination, telling them that the URL has changed to a new place with new content. The old one is useless forever, so the bots need not index that link anymore.

Why Do You Need to Set Up 301 Redirect?

In UI/UX aspect

Visitors are eager enough to click on your link for more information. Yet, they are landed on a 404. Seriously?

Magento 2 301 redirect means relocating them to the valuable content and streaming their shopping experience. Hence, they keep browsing and take a specific action, for example, placing an order.

In the SEO aspect

A better customer experience, for sure, results in a longer average time-on-page and a lower bounce rate. For your information, Google and some search engines consider UX improvement as a key factor to rank a website.

In addition, you can still attract incoming visitors to your Magento 2 website to increase your traffic and SEO juice.

More excitingly, the act of Magento 2 301 redirect will transfer almost all link equity, for specific – the ranking power, to the redirected page.

Interested in how 301 redirect affects SEO? Check it out in our comprehensive SEO guide for Magento 2.

When to Apply 301 Redirect on Magento 2?

what is 301 redirect?
When 301 redirect is useful?

Magento 2 301 redirect is useful when:

  • Moving from HTTP:// to HTTPS://
  • Rebranding or renaming your Magento 2 domain name with a different URL (301 redirect new domain)
  • Merging various web conventions into a shared URL to maximize the authority of the domain
  • Redirecting deleted/removed contents to the more valuable ones
  • For example, we redirected https://bsscommerce.com/magento-website-development to https://bsscommerce.com/magento-services 

What Are The Differences Between 301 Redirect & 302 Redirect?

From the users’ side, 301 redirect and 302 redirect work the same. They are all relocated in a new URL and keep browsing.

The difference is, how search engines treat 301 moved permanently redirect links and 302 temporary redirect. This, as a result, affects your website’s ranking power.

Wrong redirect settings and you will lose traffic, for sure.

301 vs 301 redirect
301 permanent vs 302 temporary redirect

301 moved permanently redirect

Once you set a current link to 301 redirect, it takes the search engines some time to discover the newly redirected 301 page. Then, they will transfer the rankings and trust of the predecessor to the new one.

The search spiders will stop crawling and indexing the old link. You, on the other hand, can never retrieve that link.

Favorable as it is, the 301, especially the 301 redirect new domain, requires a special command in .htaccess file (Apache server) and even more techniques when it comes to Windows servers.

Fortunately, you can use the Magento 2 SEO extension to complete this task in several clicks. We will get insight into this solution later.

302 temporary redirect

There are few cases where a 302 redirect is appropriate. You hardly temporarily move a page then come back, don’t you?

We only suggest 302 temporary redirect in case of:

  • Currently fixing or maintaining the page/site
  • Running A/B tests of design issues or something else

At that time, search engines make an assumption that the redirect link will only stay for a while. They keep the old URL and might still show them on the search result pages. As a result, it might result in bad duplicate content and hurt your SEO efforts. Not to mention, the search engines do not pour the original ranking power to the new one.

The temporary redirect is truly confusing for both webmasters and search engines. However, it is easier to set up than 301 redirect – using Javascript or meta tag. That is why many merchants still choose to use this 302 redirect.

Again, we must re-confirm it is not SEO best practice. Do the right, or pay a heavy price!

How to Apply 301 Redirect on Magento 2 Store?

Magento 2 URL Rewrites

Magento 2 Search Engine Optimization

Thankfully, Magento 2 does support 301 redirect by its nature. You can redirect any URL to a product, CMS page, or category within clicks.

Firstly, make sure you have enabled Web Server Apache Rewrites during the initial Magento setup. Go to Stores ⇒ Settings ⇒ Configuration ⇒ General and choose Web and expand the Search Engine Optimization tab.

Then, navigate to Marketing ⇒ SEO & Search ⇒ URL Reviews and Add New URL Rewrite.

Magento 2 URL Rewrites

Read later: Create URL Redirects Programmatically

Automatic Product Redirect

You can rewrite and redirect URLs separately as above, or you can configure your settings to generate a 301 permanent redirect upon any change in URL key of the product and category.

Under Stores ⇒ Settings ⇒ Configuration ⇒ Catalog, select the Catalog subitem. Expand the Search Engine Optimization section and set Create Permanent Redirect for URLs if URL Key Changed to Yes.

Set up Magento 2 Search Engine Optimization

Magento 2 301 Redirect and Robot txt Disallow

301 redirect indicates the search engines not to index the old link any longer. However, it might take time. Many webmasters wonder whether to use robot txt disallow to fasten this process. – Hmmm. It depends.

This is an example of robot txt disallow:

User-agent: [user-agent name]
Disallow: [URL string not to be crawled]

Positively, the robot txt disallow suggests the search engine bots not crawling the page. Negatively, it might reveal valuable data if you did it the wrong way.

Know how to do robot txt disallow well, and don’t mistake it for robot meta tag. Or you should have Magento 2 SEO extension complete the task for you.

What Mistakes to Avoid When Applying 301 Redirect?

Magento 2 301 redirect new domain is slick and easy, isn’t it?  However, you still need to be cautious and avoid the following mistakes. It is better safe than sorry!

301 redirect loop

301 redirect loop causes error

Before performing a Magento 2 301 redirect, think carefully whether you might need the old URL in the future. If yes, then you should choose 302 temporary redirect. Do not redirect your URL too many times, especially when page A is redirected to Page B, then for a while, the B is redirected back to the A.

Such a redirect loop makes search engines frustrated.

Chain redirects

Google stops crawling from the 4th or 5th link

Simply, a redirect chain includes one URL after another. For example, https://bsscommerce.com/magento-2-b2b.html redirects to https://bsscommerce.com/magento-2-b2b-extensions.html, then to https://bsscommerce.com/magento-2-b2b-extensions-package.html

(We don’t do like this, just an example.)

Then, both users and search engines have to wait for all redirects before stepping through. It breaks the UI/UX and tears down the SEO authority power.

No more than 4 redirects in a chain, we recommend.

Unhelpful content

That 301 redirect allows transferring almost most of SEO ranking power to the new place, many webmasters make use of it to do SEO tricks. Say, redirect all top links to a new page to rank it on the first page.

Never do that!

Make sure all redirect links must have valuable content that is associated with what users look for.

How to Fix 301 Redirect Not Working?

301 redirect failed!
301 redirect failed!

You follow all the steps, but Magento 2 301 redirect does not work. What’s wrong?

For example,

  • URL Rewrite: Custom
  • Store: Default store view
  • Request path: customer/account/create
  • Target path: customer/account/login
  • Redirect Type: Permanent(301)

Firstly, try to flush the cache and reindex the whole website. Secondly, check the request path and target path carefully to ensure there is no abundant spacing or characters.

If the Magento 2 301 redirect still fails to work, then try adding this line to .htaccess in root magento directory:

RewriteRule customer/account/create http://<mydomain>/customer/account/login [L,R=301].

Recommended Magento 2 Redirect Extensions

301 redirect in Magento 2 is frequently requested. Hence, extension vendors have developed many Free & Paid extensions to meet the demand.

Magento 2 SEO extensions by BSS Commerce

Magento 2 Extensions by BSS Commerce

301 Redirect is important, however, it is not enough to make your website pop in the fierce eCommerce world. Here we recommend the ultimate SEO package to do almost all SEO optimizations for you.

  • Gather 9 Magento 2 extensions in one
  • Solve the duplicate content worries thanks to Canonical URLs, Hreflang Tags
  • Fasten indexation through the robots meta tags, HTML/XML sitemap
  • Improve UX/UI using SEO Advanced Breadcrumbs, 301 Redirect, Open Graph, and Twitter Cards
  • Enhance SEO metadata with meta tags template
  • FREE installation | 1-year support | free-lifetime update
Check Magento 2 Extension now

Magento 2 404 Error Logger extension by Ravey Infosys

Magento 2 404 Error extension
Magento 2 404 Error extension

This extension allows finding and fixing all 404 error pages that hinder visitors from checking out your Magento 2 website.

  • Record and report 404 Error Page
  • Show how many times a broken URL ends up to 404 error page
  • Support 301 redirect and 302 redirect to fix the 404 error

Magento 2 301 Redirect extension by Mage Array

Magento 2 301 Free extension
Magento 2 301 Free extension

This 301 redirect for Magento 2 module is FREE with basic features to perform 301 moved permanently. There is neither screenshot nor demo, hence, you might download and explore it yourself.

Wrapping Up

We complete the Magento 2 301 redirect today. Should you have any queries, let us know. We have experts who know SEO ins and outs, so we are all ears to solve your problems with 301 redirect in Magento 2 and other SEO optimizations.

You could also try our finest SEO solutions collection here.

Contact us now!

 

Write A Comment

Name