About news service Total guide on 301 redirects and the htaccess file


In this guide I explain how to make redirects 301 and all types that exist. The .htaccess file you can apply all the following codes to do it. Redirects are very useful to solve 404 errors or when you have to migrate from one domain to another, or from one web structure to another. Finance Executive Email Database

Before entering the subject and see how to apply each of the 301 redirects that exist, you must have some concepts clear.

Finance Executive Email Database

You need to know, for example, what the htaccess is and how it is edited, when it is advisable to do redirects 301, what precautions should be taken and some other things … Let’s go to it!

redirection 301 What is a 301 redirect?
It is a command with which we direct visitors from one web address to another. Within this concept we find different redirection types.

The redirect 301 is nothing more than a permanent order that makes that whenever you want to access a specific URL (the redirected one) it automatically takes you to the destination URL.

For example, if you apply a 301 redirect to the website www.example.com/page1 indicating that you go to www.example.com/page2, when a user or the search bots want to access / page1, they will automatically be directed to / page2 .
 

Blogs Marketing Content What is htaccess?
The first thing you should know is where your name comes from: Hypertext Access or Hypertext Access. It is a configuration file used in Apache web servers with which webmasters can configure the policies of access to directories and files on the web to perform configurations such as redirects. It is a simple text file that you can edit with Notepad or any editor.

Microsites Marketing ContentsHow to edit the htaccess file
To be able to do the redirects 301 that we are going to see in this article it is necessary that you know how to access your htaccess file and edit it. There are different ways to apply the 301 through the htaccess.

⚠️ Be careful! ⚠️ The htaccess file is very delicate, any error in its edition can cause serious errors in the operation of a site.
I recommend that you make a backup of the files before any changes. If after making the change, you notice the slightest error on the web, undo the changes you have made or upload the backup copy that you had made.

Be meticulous and check that everything works perfectly.

  1. Via FTP: you will find the file accessing your server through an FTP client. You can use FileZilla for example or any other.

Once you have accessed you can edit the htaccess file with the rules that we will see later.

  1. With the Yoast SEO plugin for WordPress: if you have WordPress and you have installed Yoast SEO you can also edit the htaccess file.

To do this, from the WordPress admin, in the left sidebar go to SEO> Tools> File Editor. In ‘File Editor’ you will see that you can edit both the Robots.txt and the htaccess.

yoast_htaccess

  1. Through the file manager of your Hosting: where you can download and upload the file again, or use the online web code editor.

01-17 When can you need to do a 301 redirect?
There are many cases, perhaps more than you think, in which you may need a 301. Depending on the purpose of these redirects and their nature (transmit authority, avoid 404 errors, web migration, etc.) there are several cases. Let’s see several examples: