What is a redirect?
This is an essential part of maintaining your website, because when you change the URL of a page (even if it's just one more word or a domain change), you don't want users to encounter a 404 error if they use the old address.
A redirect will automatically send users who arrive via the old page to the new one. There are several cases where you'll want to use a redirect, and depending on the scenario, you'll need to use a 301 or 302.
Differences between 301 and 302 redirects
For your project, it is very important that you understand the essential differences las vegas email marketing address between these two redirects. If you make a mistake, you can harm your SEO, so read the following lines carefully.
301 Redirect
A 301 redirect is permanent and its main purpose, apart from taking users to the correct destination, is to replace one URL with another in search engine results.
Some examples:
In effect, we are telling search engines, “This page is not available right now, but if you come back in a while, it will be available again.”
Therefore, the indexed URL will not change. Examples of correct use of 302:
A/B testing. In this case, we tell the search engines not to index the different versions of the page that now exist, but to stick with the old one. When the experiment is over, they will find the winning version and can index it.
Website under maintenance, when the website is unavailable for a while.
To find out what type of redirect you are using, you can use SEO tools like Screaming Frog (for auditing multiple URLs), or the free service httpstatus to test a small number of URLs.
httpsstatus-example
Differences between 301 redirect and rel=”canonical”
Improve your SEO!
There are situations where we don’t want to or can’t implement 301 redirects. Maybe the developer in charge of maintaining the website doesn’t know how to do it (it can happen), or the CMS simply doesn’t have a simple tool to create them. The rel=”canonical” meta tag is a simple solution for such cases, since nothing is needed on the server side: editing the <head> tag is the only thing that needs to be done.
We will add that the 301 forces users and robots to visit another page, while the rel=”canonical” does not change the URL that a user visits at all and, instead, is a (very strong) suggestion to Google, not an order.
Now that we understand what a redirect is, the next step is to know how to implement it correctly so that it does its job.
How to make a 301 redirect?
Redirection with Htaccess
If you have an Apache server, you can edit the .htaccess document located in the root of your web storage. However, you have to be very careful because a mistake in editing this document can cause the website to go down for a while. Below, we explain what you have to do step by step:
Get an FTP program like FileZilla or CyberDuck (both free)
Connect to your server using the username and password given to you by your web hosting company
The document is usually hidden, so you need to enable hidden document views in your FTP program (⌘ + R on Mac)
Make a copy of the document, in case we make any mistakes while editing it.
Edit the document and save changes.
Creating redirects by editing .htaccess is the most efficient solution, although it is also more complex. But don't worry, if your website uses a CMS, there are simpler techniques. It should also be noted that what we are going to explain is recommended for a 301 redirect from one URL to another. For domain or structure changes, .htaccess is the simplest and most viable solution.
Redirection in WordPress
As always in WordPress, there is a plugin for that. All you have to do is download and install this plugin , indicate the old URL, the new one and voilà !
plugin-wordpress-redirection
If you are familiar with regular expressions, you can do it directly from here without following the steps we explained just before.
Redirection with Drupal
There is also a specific plugin for Drupal: Drupal Redirect Module . It allows more features than just implementing 301 redirects, but in this function that interests us, it is quite similar to the WordPress “Redirection” plugin.
Complete Guide: What is a 301 Redirect?
-
- Posts: 211
- Joined: Sun Dec 22, 2024 3:22 am