What is a 301 redirect and its impact on SEO + example

We will try to explain what Redirect 301 or Redirect 301 is in simple language and in the form of an example, as well as how to redirect 301 and how we can transfer the address or the same redirect in WordPress, Cpanel or .htaccess file. We will easily teach you the code and do it without the code, and we will try to tell you the impact and importance of the 301 redirect command in SEO in the form of training. Be with SEO teaching.

In this article, we have used some technical terms in SEO, some of which we will define at the beginning so that you can read this article more.

  • Index: Index means that there is an address in Google results. In fact, every address in the results is patched.
  • Search Console Search Console: Search Console is a powerful and free tool for managing your website in Google results that you can see the Search Console tutorial.
  • Fetch Fetch: An action to recall Google bots in the console search.
  • Canonical: Canonical is used to transfer the validity of an address to another address with Google without referring the user, if you are looking for a good article about Canonical, be sure to read the comprehensive article on Canonical tags.


Read 301 for a better understanding

To help you better understand the concept of 301 redirect or permanent redirect, we start today’s article with a few simple examples. Consider in the following examples what would be the solution in these situations:

  • You open the search console and check its various reports. You will notice that some URLs are indexed with www and others without www. 
  • In the search console reports, you will see the following message:duplicated without user selected canonical.

    When you look at the details of the report, you will notice that the Google 2 bots have patched the exact same URL from your site and considered one as canonical to the other. For example, 2 such addresses:


    However, you have only one page with a specific URL in the form of www.example.com/aboutus for your About Us page.


  • You are testing some of your site URLs and you will notice that your URL system is Unlimited URLs. This happens when you go to a new URL with the same content as the previous one after the unique URL of a page, for example the ID of a product. For example, consider the following URLs, all 3 of which point to the same page, and this happens indefinitely for URLs:www.example.com/cotton/14897/new-products-season1

    If you have not had this problem before, it will be a little difficult for you to understand. But the fact is that there are sites where this happens.


  • You decide to change the domain name of your site altogether. For example, your site was previously available with the address seo-teaching.ir and from today you decide to place your site on the domain seo-teaching.com. You simply enter the domain redirect code and this action takes place. 
  • You are told that the effect of SSL on SEO is good and you enable SSL, in which case the address of all your pages starts with https and you have 2 types of URLs from each page. One with https and the other without https, ie with http.

What solution do you have for solving such problems? Use canonical tags? Delete URLs? Or a better way?


What is a 301 redirect?

First we need to know what a redirect is and then use it. A 301 redirect is a permanent transfer from one address to another. By performing a 301 redirect to an address, users and even search engines will find the address they found in the search results or the address they entered directly into the search section of their browser; They will be moved to a new address. In other words, by constantly redirecting the URL of a page, you redirect the user to a new path from your site.

Redirect 301 acts like an umbrella that gathers all similar addresses together in one place by a permanent address transfer and directs them to one point. In this case, pages that have different URLs are identified by search engines with only one URL. This type of 301 redirect use allows pages to be properly authenticated by Google.


301 Redirect Impact on SEO

Before we get into how 301 redirects affect SEO for an entire site or single pages, keep in mind that the slightest change in page URL structure can affect your ranking in Google search results. This is why you need to use a 301 redirect to maintain the current location of addresses that need to be permanently redirected.

By redirecting a domain or an address, you move all the ranks of the previous address to the new address. These rankings include

  • Page Rank
  • MOZ Rank
  • Page Authority
  • Traffic Value


On the other hand, by redirecting an address to Google, you mean that it removes the previous address from its index and replaces the old address with the new one. So know that the effect of redirect on SEO is direct and if you do not do the redirect directly, it can have a negative effect on your SEO site, so if you do not have enough expertise and you are worried about the negative effect of redirect, leave it to an expert.


When do we use a 301 redirect?

Do not worry if you do not find the answers to the questions at the beginning of the article. All of the hypothetical situations mentioned above will be resolved by performing a 301 redirect or permanent page address transfer. In general, 301 redirect can be used in the following 3 general cases:

Complete redirect from one domain to another

Organize dynamic or Unlimited URLs to a shorter URL that is also preferred by search engines.
Avoid producing duplicate content
Fix 404 error


301 redirect training in different ways

301 redirect in Cpanel

Enter the C panel and go to the Rediects section as shown in the Domains section.

In this section, in the first part, specify the type of transfer (Type) because the transfer can have different types of redirects, and we select type 301 here. Then the desired domain in the section https?: // (www.)? Select and then in the third section the old address to be transferred to the new address and in the fourth section enter the new address.

For example, if the page with the address seo-teaching.com/pageA is to be redirected to a page with the address seo-teaching.com/pageB 301, you must enter the Permanent 301 option in the first part, PageA in the third part and seo-teaching.com/pageB in the fourth part. do.

Redirect 301 in WordPress + Introducing the best plugin
If you use WordPress CMS, there are many plugins that do the redirect work for you. One of the plugins that the official WordPress site updated about 9 months ago is the Simple 301 Redirect plugin. You can see it in this link.

If you have the full version of the Yoast plugin, you can define your pages as a 301 redirect from the Redirect Manager section (in Persian it is called “redirect”). Select one of the types of redirects according to the figure below. (Select the first option for 301 redirects.)

Now, according to what we mentioned in the 301 Redirect tutorial in C Panel, you can easily fill in the different parts of this plugin.

Another WordPress plugin that helps you automatically move from page to page is the Quick Page / Post Redirect plugin. Working with this plugin is also very simple and you just need to enter the type of redirect and old and new addresses in it.

But if you do not have the professional version of the USB plugin and you are looking for the best WordPress redirect plugin for URL transfer, I suggest you check out the redirection plugin. Click on the image below to view this plugin.


Application redirect code 301 using .htaccess file

Sometimes you might want to do a 301 redirect without a plugin. If you want to do a redirect directly by changing the server-side files, keep in mind that we can insert different code using the .htaccess file, such as a domain. Moved to another domain or an address to another address or even moved a series of addresses to a specific address. Now to use one of them according to your needs.

Code 1

Just don’t forget the example we gave from SEO teaching website to better understand, we are going to move pageA to pageB in seo-teaching.com domain.

Redirect code 301 from one address to another in the same domain

Redirect 301 /pageA /pageB

Code 2

Redirect code 301 An address to another address on a domain other than your own

Redirect 301 / pageA https://newseo-teaching.com/pageB

Code 3

Redirect code 301 old domain to new domain in .htaccess

Here seo-teaching.ir is an old domain and seo-teaching.com is a new domain. Try typing seo-teaching.ir in your browser right now.

# Note by SEO teaching: Redirect from old-website to new-website
RewriteEngine on
RewriteCond% {HTTP_HOST} ^ seo-teaching.ir [NC, OR]
RewriteCond% {HTTP_HOST ^ ^ www.seo-teaching.ir [NC]
RewriteRule ^ (. *) $ Https://seo-teaching.com/$1 [L, R = 301, NC]

Code 4

301 redirect code for all pages as well as the old domain to all pages in the new domain using the .htaccess file

Here, if we type any address from the seo-teaching.ir domain, the same address in the seo-teaching.com domain will open well. For example, type the address seo-teaching.ir/seo and enter the following code: The address seo-teaching.com/seo will open.

The following code must be inserted at the beginning of the .htaccess file.

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^ (. *) $ Https://seo-teaching.com/$1 [R = 301, L]

Code 5

Redirect code 301 Address without www to address with www in .htaccess

For example, if you want to move seo-teaching.com to www.seo-teaching.com, this code is appropriate. Make sure your domain is http and https, and enter your domain instead of the SEO teaching domain.

# Note by SEO teaching: Redirect from non-www to www
RewriteEngine on
RewriteCond% {HTTP_HOST ^ iz seo-teaching.com [NC]
RewriteRule ^ (. *) $ Https://www.seo-teaching.com/$1 [L, R = 301, NC]

Code 6

Redirect code 301 Address with www to address with www in .htaccess

For example, if you want to move the address www.seo-teaching.com to seo-teaching.com, this code is appropriate. Make sure your domain is http and https, and enter your domain instead of the SEO teaching domain.

# Note by SEO teaching: Redirect from www to non-www
RewriteEngine on
RewriteCond% {HTTP_HOST ^ ^ www.seo-teaching.com [NC]
RewriteRule ^ (. *) $ Https://seo-teaching.com/$1 [L, R = 301, NC]

Code 7

Redirect code 301 http address to https address with .htaccess

If you want to move the address http://seo-teaching.com to https://seo-teaching.com, for example, the following code is a good option, pay attention to whether your domain is www or not, and only the last line is based on Keep in mind.

# Note by SEO teaching: Redirect from http to https
RewriteEngine On
RewriteCond% {SERVER_PORT} 80
RewriteCond% {HTTP_HOST ^ ^ (www \.)? seo-teaching \ .com
RewriteRule ^ (. *) $ Https://seo-teaching.com/$1 [R, L]

Code 8

This is another code that is domain independent.

# Note by SEO teaching: Redirect from http to https
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond% {HTTPS} off
RewriteRule ^ (. *) $ Https: //% {HTTP_HOST}% {REQUEST_URI} [L, R = 301]

Code 9

301 redirect code to transfer AMP addresses to non-AMP in .htaccess

If you have used WordPress AMP plugins and after a while you disable this plugin, the addresses created by the amp plugin give 404 errors and you will see these errors little by little in the console search. If for any other reason you do not want to activate WordPress amp pages, enter the following code in the .htaccess file.

# Note by SEO teaching: Redirect from AMP to non-AMP
RewriteEngine On
RewriteCond% {REQUEST_URI} (. +) / Amp (. *) $
RewriteCond% {REQUEST_URI}! ^ / Wp-content /(.*)$
RewriteRule ^% 1 / [R = 301, L]

If you are using the WordPress redirection plugin mentioned above, you can implement its settings as follows to transfer amp addresses to non-amp addresses.

Source URL: /(.*)\/amp

Target URL: https://www.yourdomain.com/$1


Of course, the htaccessredirect site is also available and you can even create a custom redirect code.

Code 10

301 redirect code to transfer the address without slash to the address with slash using the .htaccess file

For example, if you want to move seo-teaching.com/seo to seo-teaching.com/seo/, the following code is suggested. However, this may not work due to some of your server settings as well as your site settings. In this case, contact the host or site backup.

# Note by SEO teaching: Redirect Non-Slash to Slash URLs
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^ (. * [^ /]) $ / $ 1 / [L, R = 301]

Code 11

301 redirect code to transfer a slash address to a non-slash address in .htaccess

The opposite of the example above works.

# Note by SEO teaching: Redirect Slash to Non-Slash URLs
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^ (. *) / $ / $ 1 [L, R = 301]

Code 12

301 redirect code to move a slash-free address to an address with a slash in .htaccess

For example, if you want to move the uppercase address seo-teaching.com/SEO/ to seo-teaching.com/seo/, the following code is suggested. Of course, as we said before, these codes work properly when they do not interfere with the configuration of your hosts and your site. Especially WordPress friends, the problem of redirecting WordPress sometimes has nothing to do with the redirect code in htaccess.

# Note by SEO teaching: Redirect Uppercase to Lowercase
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule [A-Z] – [E = HASCAPS: TRUE, S = 1]
RewriteRule! [A-Z] – [S = 28]
RewriteRule ^ ([^ A] *) A (. *) $ $ 1a $ 2
RewriteRule ^ ([^ B] *) B (. *) $ $ 1b $ 2
RewriteRule ^ ([^ C] *) C (. *) $ $ 1c $ 2
RewriteRule ^ ([^ D] *) D (. *) $ $ 1d $ 2
RewriteRule ^ ([^ E] *) E (. *) $ $ 1e $ 2
RewriteRule ^ ([^ F] *) F (. *) $ $ 1f $ 2
RewriteRule ^ ([^ G] *) G (. *) $ $ 1g $ 2
RewriteRule ^ ([^ H] *) H (. *) $ $ 1h $ 2
RewriteRule ^ ([^ I] *) I (. *) $ $ 1i $ 2
RewriteRule ^ ([^ J] *) J (. *) $ $ 1j $ 2
RewriteRule ^ ([^ K] *) K (. *) $ $ 1k $ 2
RewriteRule ^ ([^ L] *) L (. *) $ $ 1l $ 2
RewriteRule ^ ([^ M] *) M (. *) $ $ 1m $ 2
RewriteRule ^ ([^ N] *) N (. *) $ $ 1n $ 2
RewriteRule ^ ([^ O] *) O (. *) $ $ 1o $ 2
RewriteRule ^ ([^ P] *) P (. *) $ $ 1p $ 2
RewriteRule ^ ([^ Q] *) Q (. *) $ $ 1q $ 2
RewriteRule ^ ([^ R] *) R (. *) $ $ 1r $ 2
RewriteRule ^ ([^ S] *) S (. *) $ $ 1s $ 2
RewriteRule ^ ([^ T] *) T (. *) $ $ 1t $ 2
RewriteRule ^ ([^ U] *) U (. *) $ $ 1u $ 2
RewriteRule ^ ([^ V] *) V (. *) $ $ 1v $ 2
RewriteRule ^ ([^ W] *) W (. *) $ $ 1w $ 2
RewriteRule ^ ([^ X] *) X (. *) $ $ 1x $ 2
RewriteRule ^ ([^ Y] *) Y (. *) $ $ 1y $ 2
RewriteRule ^ ([^ Z] *) Z (. *) $ $ 1z $ 2
RewriteRule [A-Z] – [N]
RewriteCond% {ENV: HASCAPS} TRUE
RewriteRule ^ /? (. *) / $ 1 [R = 301, L]


Common Mistakes Using Redirects 301

The first problem:

One of the most common problems SEOs have when redirecting an address is building a redirect chain.

What is a redirect chain?

Consider the following example:

Page “A” is out of date. Redirect page 301 “a” to page “b”

Page “b” is out of date. Redirect page “b” to page “c”

Page “c” is out of date. Redirect page “c” to page “d”

Page “d” is the page in question.

The redirect chain is one of the most horrible things that happens when an address is transferred. When a redirect chain occurs, the rankings mentioned above cannot be moved to pages with new addresses. Are you following the gtmetrix debugging tutorial? There are only 3 errors on the GTmetrix website that are related to these redirects and warns you to avoid these types of redirects. The errors are:

  • Fix Avoid landing page redirects
  • Fix Minimize Redirects error
  • Fix Avoid URL redirects error
  • To see the above fixes, read the Avoid landing page redirects article.

To solve this problem, it is better to modify the 301 redirect as follows:

Redirect page “a” to page “d”.

Redirect page “b” to page “d”.

Redirect page “c” to page “d”.


The second problem:

A common problem with redirecting or permanently redirecting a site’s URLs is the constant redirecting of deleted pages to the site’s home page. In other words, some people transfer everything they have 404 pages to the main page of the site. If you want Google to value your site, it is better to spend some time and redirect the deleted URLs to the nearest and most similar page on the site. Even if you do not consider Google, a moment to the user experience of your site and the feeling that the user will have when moving to a page completely unrelated to his request; think.


Example of doing a 301 redirect and permanently transferring the URL of a site pages

Now it’s time to look more closely at the examples we gave at the beginning of this article.

  • If you notice from the reports provided by Google tools such as Console Search or any other tool that your page URLs are not the same (some URLs open with www, some with https and)), you are still a You have not defined a consistent URL structure for your pages. For example, if the URL of all pages is defined as https://example.com. In this case, with the help of 301 redirect, the www addresses should be transferred to the addresses without www, and then the http addresses should be redirected to the 301 https addresses.


  • Google bots are sensitive to the small or large English letters that appear on URLs. Redirect all addresses created by an extra slash, uppercase or lowercase comma from an address to the original 301 redirect. Do you really think the Persian address is better or English? 
  • If you have recently used SSL or have changed your domain, you must notify Google bots of these address changes using the 301 redirect code on the server. Learn how to redirect the site address from http to https. 
  • Stop generating dynamic URLs on your site. Redirect all Unlimited URLs created for a product to the original product address 301 so that the product gets both the correct ranking and is not subject to duplicate content law.



Well, we have reached the end of the article and we expect you to know exactly what a 301 redirect is and what effect it has on SEO and increasing your website ranking in Google. You should also know how to transfer a website with 301 redirect in WordPress as well as non-WordPress sites and be able to do the transfer with code as well as without code and with the help of plugins. We also tried to fully explain the important mistakes in the redirect action so that this action does not have negative effects on your website SEO.

Of course, keep in mind that if you do not use the Google Console search tool, you will miss the biggest opportunity to improve your website in Google results. Because many errors that need to be redirected are identified by the Google Console search tool. So be sure to read the SEO teaching. console search tutorials. (Available in the website menu)

Since transferring an URL with the help of a 301 redirect may seem a bit complicated at first, be sure to ask us your questions so that you do not mistakenly lose the credibility of your site pages in Google.

Leave a Comment