What is a 301 redirect
To know what a 301 redirection in wordpress is, we must first understand the following. When a web url is indexed in Google, it is stored in the browser, and it is the address that appears when we do a search: for example https://www.midominio.com/servcio-mantenimiento .
Well, if at a given moment we are going to change the domain, or change the url on which we are working. What will happen is that, when we do this, Google will get the impression that the old url does not exist (when the content does exist). And therefore a 404 error will appear when we click on the search result, so you can be penalised by Google.
To avoid these problems, we have to perform a 301 redirect. This is nothing more than a substitution of one URL address for another.
301 redirection in wordpress
301 redirection in wordpress
What is a 301 redirect for?
As we mentioned before, what a 301 redirect is for is to avoid 404 errors on our website. That in this case appear as a result of changes in our URL or domain of our website.
In this way, search engine bots and users can access the contents of our website without noticing the change of url.
You have to take into account that it is necessary to carry out this process in order to avoid your website being penalised. And above all, to avoid giving a bad impression to the visitors of your website, in which they get the 404 error.
On the other hand, thanks to this type of redirection you will not lose any traffic. And you won't lose the positions your website has achieved in search engines either.
301 redirection in wordpress
301 redirection in wordpress
When to do a 301 redirect
Mainly this type of process is done for several reasons:
- You are going to change the domain of your website to another domain.
- You have outdated content that you want to change and send users to more up-to-date content with a different URL.
- For reasons of interest to change the canonical URL as a result of search strings that are working on the SEO of your website. Where you have seen that you need to make this change as a consequence of the web positioning of your website.
301 redirection in wordpress
301 redirection in wordpress
How to create a 301 redirect in wordpress
We already know that wordpress is a web development which speeds up the development process of a website. And it is also fed by many plugins to make web development even easier. Well, as it is logical in wordpress we can find several plugins that help us to make the 301 redirection.
The truth is that there are many plugins that help us to perform a 301 redirect in wordpress. Anyway, we give you the 2 plugins that are most used, and that at the same time, are simple to use.
For example we have the plugin Redirection. With this plugin you can control the 404 errors on your website. And so you can convert them into the 301 redirection you need.
Rank Math SEO is a plugin similar to Yoast Seo, which already has an integrated 301 redirect manager. It also has the feature, as before, to give you the 404 error statistics of your website.
301 redirection in wordpress
301 redirection in wordpress
How to create a redirect with .htacces
This is another way to perform a 301 redirect in wordpress on your website, but it requires more knowledge. It is not as automated as wordpress. Even so it is convenient that you can know it in case you need to do it.
The .htacces file is a file that is stored in the root folder of your website files. You will need to access this file (via FTP for example) and then edit it.
It is important, that you first give permissions to the server to use rewrite mode in Apache, that is:
RewriteEngine On
And then the instructions you have to insert are very simple. We have it for two options:
1. Redirect a URL within the same domain, i.e. from old to new addresses. You can also put one instruction under another without any problem, depending on the number of 301 redirects you need to perform. An example would look like this:
<IfModule mod_rewrite.c> RewriteEngine On </IfModule>
2. Or, we have the other option, which is to redirect a domain name. This would leave us with an example:
RewriteEngine On RewriteCond %{HTTP_HOST} ^(?:www\.)oldsite\.com$ [NC] RewriteRule ^http://newsite.com%{REQUEST_URI} [L,R=301]
There are actually more ways to make a 301 redirect in the .htaccess file, and each with a specific purpose. There are also tools that can help you create them, such as the website aleydasolis. In which you can see the different ways of performing 301 redirections.
Well now you have more information on what is a 301 redirect in wordpress, and especially why it is necessary to do this work on our website.