Page 1 of 1

The definitive guide to 301 redirects

Posted: Sun Jan 19, 2025 8:13 am
by shukla7789
Creativemotions»WordPress Tips & Guides»The definitive guide to 301 redirects

The Ultimate Guide to Creating a 301 Redirect
We have already mentioned the 301 redirect when we discussed duplicate content and the different solutions to solve this type of problem. But until now we have never delved into what a 301 redirect is , how to create it and use it.

In this article, we will answer all these questions so that you can set up a 301 redirect on your own when and if needed.

Let's dive in!

Table of Contents view
301 Redirects: What Are They?
A redirect allows you to redirect Internet users who south africa phone number data at a URL A to a URL B. This process is automatic and very often users do not realize it, which is rather ideal to not worsen their browsing experience.

There are different types of redirects : some are permanent, some are temporary. The 301 redirect indicates a permanent redirect.

In other words, when you set up a 301 redirect , you are telling search engine spiders that the web page at an old URL has been permanently moved to a new web page.

Diagram of a 301 redirect
Attention! We are talking about a web page but a 301 redirect can be used to do a complete site redirect , that is, on the domain name.

Read also: PHP Redirect: How to Do It (Safely)

Redirect 301: When to Use It?
As we have just seen, the 301 redirect is not the only redirect that exists. You may have heard of 302 redirects, 307 redirects, meta-refreshes, etc. In fact, each redirect has a different use. So in what situations should you opt for a 301 redirect ?

Here are the most common ones.

When you change your domain name
This can happen if, for example, you change your brand name. The content under your old domain name should be accessible through your new URL. Here, you should not copy the content from the old site to the new domain because you risk creating duplicate content.

Additionally, this 301 redirect allows you to maintain and transfer the authority of your old site pages.

When you change the structure of your URLs
This situation can occur if you decide to lighten your URLs for readability reasons or if you add elements.

In some cases you may want to remove the category wording from your URLs, for example :

www.miosito.it/categoria/sport/calcio-a-cinque
would become

www.miosito.it/sport/calcio-a-cinque
This redirect is even more important because it is possible that third-party sites will direct their users to your product soccer-shoes with the old URL. If the 301 redirect is not done , Internet users will encounter a 404 error that can be handled with a 404 page created for the purpose.

If your home page is accessible from multiple URLs
The same content accessible under different URLs is a source of duplicate content and, as you know, this is very harmful for SEO. Your home page can be visited with a URL containing “www” or not, with “.it/” at the end or simply “.it”.

To give more authority to your home page and avoid duplicate content, a permanent 301 redirect will redirect all users to a single URL.

How to do 301 redirect?
Let's see two ways to use a 301 redirect: the first directly through the .htaccess file , the second with the help of a WordPress plugin.

How to Make a .htaccess Redirect 301
The .htaccess file is a configuration file used to modify the operation of the server. You can find it in the root of your site. A peculiarity of this file is that it is sometimes hidden. If you do not see it, open the terminal of your computer and enter the following command line (for Mac):

defaults write com.apple.finder AppleShowAllFiles TRUE

Access hidden files on Mac
If you are in Windows 10, type “folder” in the search box located on the taskbar. Search for Show hidden files and folders , then select it under Advanced settings .

If you go back to the root of your website you should see the famous .htaccess file.