What is Link Redirection? 301 vs 302 vs 404 URL Redirection

What is Link Redirection? 301 URL Redirect, 302 Post Redirect, 404 Redirect

Broken Link Redirection 301 vs 404 redirection, 301 vs 302 redirect

Redirection is the techniques that allow your users and Google bots to land on an updated URL. It also helps you to prevent showing an error page or the page does not exist message to the user and bots. The page redirection technique allows you to set a rule to land your users on the newly assigned URL. It also helps you not to lose your regular traffic on the site. In this article, we will learn 301 vs 404, 301 vs 302 redirect, how to redirect for 301 pages, 404 pages, and 302 pages. Also, you will learn, when to use this and if it affects your Search Engine performance.

There are mainly 4 types of redirection in SEO and it can be resolved by adding a few lines of code into the header section of .htaccess file.
To open it, go to cPanel>> .htaccess file>> Click to edit. Make sure to save a copy before editing the file.

Page Redirection 301, 302, 404

What are the 4 Types of SEO Page Redirections?

1. What is a 301 Redirection? Permanent Redirection

301 Redirection maintains your SEO backlinks while redirecting to other addresses. It can be used in multiple cases, such as:

  1. You have recently hosted a new website similar to your old one, and want to move all the coming traffics to the newly hosted site.
  2. You want to redirect the traffic of a few pages to the new page
  3. You have discontinued some products or services on your site but don’t want to show an error message to the users who are coming to that page
301 Page Redirection

You can redirect your website’s URL permanently by following the below steps:

Code for www to non-www redirection

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

Code for Non-www to www redirection

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

301 Redirection Code for Pages or Posts

# BEGIN 301 Redirects
Redirect 301 /existing-page-name/ https://www.website.com/new-page-name/
# END 301 Redirects

If you want to make multiple pages or post redirection, structure your code like this:

# BEGIN 301 Redirects
Redirect 301 /existing-page/ https://www.website.com/new-page/
Redirect 301 / existing-page-2/ https://www.website.com/new-page-2/
Redirect 301 / existing-post-3/ https://www.website.com/new-post-3/
# END 301 Redirects

NOTE: You can also make the changes using redirections plugins available on WordPress database which will help you to remain the on page SEO & off page SEO backlinks constant.

2. What is 302 Redirection? Temporary Redirection

If your website is under construction or, due to any circumstances, you want to make your site off and redirect your existing users to a different URL, use the 302 Redirection method. It will help you to make your current URL live again after a few days.

Code for 302 Redirects for Pages or Posts

302 Redirection Code for a Page

# BEGIN 302 Redirects
Redirect 302 /existing-page/ https://www.yourwebsite.com/new-page/
# END 302 Redirects

302 Redirection Code for a Post

# BEGIN 302 Redirects
Redirect 302 /existing-post/ https://www.yourwebsite.com/new-post/
# END 302 Redirects

3. Duplicate Page RedirectionRel=Canonical Redirection

It is used to notify the Google bot that the content given on the two or more URLs is the same. And it’s not the two different pages.

In simple words, the “rel=canonical“ tag helps to understand the crawler that even if the content is duplicated on two pages, the thing is the same and index my preferred page among them.

These all can be done by using Page redirection techniques. The noticeable point in this tag is you will have to put the preferred URL only, not the URL1 & URL2. Interesting, isn’t it?

There are many cases where you may be required to use the rel=canonical
tag, a few of them are as follows:

A) Your website is getting opened on all the variations like the below URLs

URL 1: https://mithvin.com/
URL 2: http://mithvin.com/
URL 3: mithvin.com/
URL 4: mithvin.com/

B) You have added a product shoe that is available in multiple sizes, such as small, medium, and big. Here, all your details would be the same, but after filtering by user, the page URLs may look like

https://www.yourdomain.com/shoes?size=small
https://www.yourdomain.com/shoes?size=medium
https://www.yourdomain.com/shoes?size=big

So, in that case, you can use the “rel=canonical” tag by following the below structure
<link rel=”canonical” href=” https://www.yourdomain.com/” />

C) If you have created any updated version of the same posts, such as privacy policy, disclaimer, payment options, etc., then you can canonicalize it using the same tag as below
<link rel=”canonical” href=” https://www.yourdomain.com/your-updated-page-url/” />

D) Any website has copied your content and posted it on their site. In that case, you can use the tag to mark the preferred URL.

4. 404 Error Page (Non-Available Page Redirection)

What Does 404 Error Mean?

Sometimes it happens that the user is searching for your internal pages manually and they made some spelling or symbol mistakes. At that time your 404 custom page will redirect them to a targeted URL. 404 Error can be customized for some other reasons too using the page redirections technique.

How to solve the 404 Error?

404 Error Page Redirection

Step 1: Create a custom 404 Error page Design as usual by giving some redirection options and an eye-catching layout to attract the viewers. Rename the file for your reference. E.g. 404

Step 2: Now open the .htaccess file and, insert the below code & save it. It’s done

Code Structure: ErrorDocument 404 /your custom 404 page name with .html extension
e.g. ErrorDocument 404 /404.html

Step 3: All the non-existing pages of your domain will be redirected to this custom page you have designed.

If you don’t want to play with these codes, you can use some popular redirection plugins for your WordPress website:-

FAQs

Insights
Scroll to Top