What Is A Redirect

Table of contents:

What Is A Redirect
What Is A Redirect

Video: What Is A Redirect

Video: What Is A Redirect
Video: How (and Why) to Redirect a URL 2024, November
Anonim

A redirect is the automatic redirection of users from one URL to another. Technically, a redirect can be done in different ways. It can work both server-side and client-side (in the browser).

Redirect is required when changing a domain
Redirect is required when changing a domain

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

What is a redirect for?

The most common situation is changing the domain name of the site. The need for a redirect most often arises in the case of commercial sites, so as not to lose customers who came to the site at the old address. This is most relevant for online stores that have moved to another domain, but customers still visit the store page at a non-existent address.

The second common use of automatic forwarding is domain name splicing. The URL address of any Internet resource can be entered in the address bar in full, that is, with www - "www.site.ru" and without www - "site.ru". However, search engines perceive these two address constructs as two completely different sites. Therefore, in the server settings, you must specify one of these addresses as the main (main mirror), and redirect to the main mirror from the second address. Then, in any case, visitors will get to the resource they need, and search robots will correctly identify the main mirror.

Domain name splicing can be done in different ways. An alternative to creating a redirect script is to set up the main mirror in your Yandex-webmaster personal account. To do this, you must first create an account in the Yandex-Webmaster system and add your site there. But in order for the search engines Yahoo and Google to correctly identify the main mirror, a 301 redirect is required, which is created in the htaccess file. This file is stored on the server in the root directory of the site.

What is a 301 redirect?

The number 301 is the status code of the redirect occurring at the server level. This code indicates that the resource or its separate page will be permanently located at a different address. It should be noted that status code 302 is used for temporary movements.

Most often, 301 redirects are used to glue domains with www and without www. It is also irreplaceable in cases where the site moves to a new domain. In addition, it is used when transferring internal pages of the site.

Recommended: