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.
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:
- 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.
- You want to redirect the traffic of a few pages to the new page
- 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
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 Redirection – Rel=Canonical Redirection
It is used to notify the Google bot that the content given on the two or more URLs is the same. 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. And 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://www.mithvin.com/
URL 2: https://www.mithvin.com/
URL 3: www.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?
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:-
What is link redirection?
Link redirection is the process of forwarding one URL to a different URL. This can help direct users and search engines to the correct page when a URL changes or is no longer available.
What is a 301 URL redirect?
A 301 redirect is a permanent redirect that signals to search engines that a page has permanently moved to a new location. This helps in transferring the SEO value from the old URL to the new one.
What is a 302 Post redirect?
A 302 redirect is a temporary redirect that indicates a page has moved temporarily. Search engines understand that the original URL might be reinstated in the future, so they do not transfer SEO value to the new URL.
What is a 404 redirect?
A 404 redirect is not a standard redirect but rather a response code indicating that the requested URL was not found on the server. It usually suggests that the page has been deleted or moved without a proper redirect.
When should you use a 301 redirect?
Use a 301 redirect when you permanently move a page to a new URL, such as when rebranding, restructuring your website, or fixing broken links.
When should you use a 302 redirect?
Use a 302 redirect when you temporarily move a page, such as during site maintenance, A/B testing, or seasonal promotions, where the original URL is expected to return.
How does a 301 redirect affect SEO?
A 301 redirect helps preserve the SEO value of the original URL by transferring link equity to the new URL, ensuring that search engine rankings and traffic are maintained.
How does a 302 redirect affect SEO?
A 302 redirect does not transfer SEO value since it indicates a temporary change. Search engines may continue to index the original URL, which can affect the new URL’s visibility in search results.
Why is it important to set up proper redirects for broken links?
Proper redirects prevent 404 errors, improve user experience by guiding visitors to the correct page, and maintain SEO value by ensuring link equity is not lost.
Can you use both 301 and 302 redirects on the same page?
It’s not recommended to use both 301 and 302 redirects on the same page simultaneously as it can confuse search engines and users. Choose the appropriate redirect based on whether the move is permanent or temporary.