Redirect — a concept from the field of Internet technologies. A redirect is an automatic redirect user from one web address to another. It works as follows: for example, the user types in the address bar of your browser the address "site.ru" but after automatic redirection goes to the site with the address "www.new-site.ru".

Why the need for a redirect?



The most common situation is to change the domain name of the website. The need was redirected most often occurs in the case of commercial sites, in order not to lose customers who visited the site at the old address. It is most relevant for online stores that moved to another domain, but clients still go to the store page for a non-existent address.


The second common case of the use of automatic redirection is the gluing of domain names. The URL for any Internet resource can be typed into the address bar completely, ie from the www "www.site.ru" without www "site.ru". However, the search engines perceive the two address structures as two completely different sites. So in the server settings, you must specify one of these addresses as the primary (main mirror), and the second ' to implement a redirect to the main mirror. Then the visitors in any case will fall on the desired resource, and search engines can correctly identify the main mirror.

Gluing domain names can be implemented in different ways. An alternative to creating a script, a redirect is to configure the main mirror in a private office "Yandex-webmaster". For this, you must first create an account in the system Yandex-webmaster" and add your website. But in order for search engines Yahoo and Google correctly identified the primary mirror will need a 301 redirect which is created in the htaccess file. This file is stored on the server in the root directory of the website.

What is 301 redirect?



The number 301 is the status code a redirect occurring on the server level. This code indicates that the resource or page will be at a different address permanently. It should be noted that for the temporary movement uses the status code 302.

Most often, a 301 redirect is used to glue the domains with www and without www. Also it is indispensable in cases when the site moved to a new domain. In addition, it is used to transfer internal pages.