Have you ever wanted to change a website address or URL for some reason? Whatever the reason, you don’t have to lose the good reputation your old domain had. The trick is to do a 301 redirect.
In this article, you’ll learn what a 301 redirect means, how it affects search engine optimization (SEO), and how to do it. Happy reading!
Table of Contents
What are redirects?
Before understanding the meaning of a 301 redirect, it’s a good idea to listen to the following explanation of the redirect.
Definition of Redirect
When entering the address of a website into the address bar of your internet browser, sometimes the URL changes when the web page is loaded.
For example, you want to access website A with the address blog.mywebsite.com. However, the URL was later changed to my website.com/blog. This is what is meant by redirects.
In other words, a redirect is a redirection of site visitors from a URL owned by a website to another address.
Redirects themselves are divided into several types and the 301 redirects are one of them. However, how is it different from a regular redirect?
Definition of 301 Redirects
A 301 redirect is the permanent transfer of a certain website or page belonging to that site from one address to another.
This type of redirect is usually used in several ways, including when you decide to create a new website and move all the old content to it.
In this scenario, you may have announced the move of the old site to the new one to all your visitors. However, there may be a lot of people who don’t know about this. By using a 301 redirect, visitors who access the old address can still enter your website.
In addition, 301 redirects are also often applied to redirect traffic from one blog post to a new post and change the HTTP protocol to HTTPS after installing the SSL certificate.
On the other hand, 301 redirects don’t just affect website accessibility. The search engines will also consider your new URL as the correct website address. Therefore, implementing a 301 redirect is also related to SEO. This continuity will be explained in the next section.
Benefits of 301 Redirects Against SEO
Now you know that a 301 redirect works to redirect visitors and search engines from the old website address to the new URL. However, what is the benefits that can be obtained from this? Here are three reasons why you need to do a 301 redirect.
Maintaining Your Site Rank
When you need to redirect, of course, you don’t want the hard work of building website rankings to go to waste. Therein lies the benefit of a 301 redirect.
This redirect technique moves certain websites or pages in it to a new address permanently. Thus, you can maintain website rankings. The effectiveness of 301 redirects reaches 90 to 99 percent .
Ensuring Your Website Can Be Accessed
A blank page with the text “404 error” usually appears when someone accesses a website whose URL has been removed or changed.
Although this does not affect the site’s ranking in search engines, the motivation of visitors to come back can decrease. Especially if the website you are running is a company profile or online store. This can reduce its credibility.
To ensure that the error page doesn’t appear and visitors still “land” at the desired address, you need to use a 301 redirect.
Convincing Search Engines to Show New URLs
The purpose of a 301 redirect other than for the convenience of visitors is to tell search engines that you are no longer using an old URL.
Gradually, search engines will replace your website address which is usually displayed with a new URL.
How to Redirect 301
These redirects are very useful for maintaining a website’s reputation, but how do you do it? Check out the two methods below.
1. Change Settings in .htaccess
You can enable a 301 redirect by changing the settings in the .htaccess file. This file can be found in the root directory of your website. However, these files only exist if your web hosting server uses Apache software.
For those who use Nginx or other software, you can create the file with a text editor application such as Notepad or Atom. You just have to save it with the name .htaccess and put it in the root directory.
Then, open the file. Depending on the changes you want to make, you will need to type a different code in it.
Redirect from Old Address to New Address
Let’s start by replacing your old domain with a new one. For example, you want to change mysite.com to newsite.com. For that, enter the code below:
RewriteEngine on RewriteCond %{HTTP_HOST} ^mysite.com [NC,OR] RewriteCond %{HTTP_HOST} ^www.mysite.com [NC] RewriteRule ^(.*)$ https://newsite.com/$1 [L,R=301,NC]
Redirect to Remove www
An example of the second case is when you want to remove www in the URL so that the website can still be accessed without including it. If so, use the following code:
RewriteEngine on RewriteCond %{HTTP_HOST} ^www.mysite.com [NC] RewriteRule ^(.*)$ http://mysite.com/$1 [L,R=301,NC]
Redirect to Change Page URL
So what if you want to change the URL of a particular page? For example, say you want to change http://mysite.com/blog.html to http://mysite.com/blog. You just need to enter the code like this:
Redirect 301 /blog.html https://.mysite.com/blog
Note that you don’t need to add the RewriteEngine on a line of code if your .htaccess file already has one.
2. Using WordPress Plugins
If you’re a WordPress user, there’s an easier way to do a 301 redirect, using the Redirection plugin.
With this plugin, users don’t need to do any coding at all. All you have to do is enter the new and old URLs, then click the Add Redirect button as shown in the image below.
However, keep in mind that this plugin only allows the implementation of 301 redirects per website page in a single. If you want to move the entire website from the old URL to the new URL, you need to change the settings in the .htaccess file.
If your web hosting control panel uses cPanel, you can also redirect it with the menu provided. See how in this article.
Closing
Redirect 301 is the right technique to change the URL or address of your website without losing the ranking of your old domain.
Two ways can be done to activate a 301 redirect, namely inserting the code into the .htaccess file and using the Redirection plugin in WordPress.
I hope this article is useful for you. If you have any questions, don’t hesitate to leave a comment in the column below.