Mirrors are sites with different addresses and identical content. These include resources with 2 versions of the address (with and without the www prefix). In most cases, they are automatically identified by search engines. Only the main mirror is displayed in the search results. This may lead to a loss of link mass, which can affect the placement of the resource in search results .
For example, some users use an address with www, others without this prefix. The search engine selects one of the options, without taking into account links from external sources to the second in the ranking.
How do mirrors appear?
Mirrors are often created by resource administrators themselves. This allows you to solve a number of problems:
- Attracting type-in traffic. Users enter the address in different ways, including with errors. To avoid losing them, you can create a mirror with 301 Redirect configured. It will redirect traffic to the main version of the resource;
- Ensuring accessibility. Mirrors can be hosted on different servers and domains. If the main version of the resource stops working, users will be redirected to alternate addresses;
- Domain change. Gluing mirrors with reassignment to the main version of the site allows you to save positions and most of the weight when changing the resource URL.
Another reason is the automatic creation of mirrors. The search engine considers links with and without www different. In this case, gluing and selection of the main version of the site is carried out automatically.

Domain with or without www
There is no consensus regarding the choice of domain format with or without www. Well-founded, rational arguments are given in favor of both options.
Why choose links without www:
- Better in terms of usability. The user will have to type 4 characters less. This is especially critical when accessing the Internet from mobile devices;
- No meaningless data in the URL. At the moment, the www prefix does not contain any semantic meaning. The user by default knows that the site is located on the Global Network;
- Code reduction. Each character has a weight. The more there are, the higher the load on the server and the need for free space.
Why choose links from www:
- established way of behavior. Some users are accustomed to URLs with a prefix;
- ease of identification outside the Global Network. It is easier for a person to determine that there is an Internet site address in front of him if there is a prefix in it;
- Some experts believe that the presence of www in short URLs makes them more attractive;
- The services of the largest search engines use the prefix in their addresses.

Assigning and gluing mirrors manually
To combine any number of mirrors and redirect all traffic to the main version of the site, 301 Redirect is used. Implementation of this task requires working with 2 files from the root directory robots.txt and .htaccess. In the first one, it is enough to specify the main host after all the indexing rules. To do this, use the “Host:” directive. The main address is entered on the same line.
C.htaccess is a little more complicated. For several different domains, the following notation is used:
RewriteCond %{HTTP_HOST} ^site.com$ [OR,NC] RewriteCond %{HTTP_HOST} ^www.site.com$ [NC] RewriteCond %{REQUEST_URI} !^/robots.* RewriteRule ^(.*)$ http:// site.com.ua/$1 [R=301,L]
Glueable domains are inserted instead of site.com. The last line indicates the main URL.
If you need to glue mirrors with different prefixes, use the following notation:
RewriteCond %{HTTP_HOST} ^www.site.ua [NC] RewriteRule ^(.*)$ http://site.ua/$1 [R=301,L]
In this example, the site without a prefix is assigned as the main site. To do the reverse operation, you need to swap the addresses.
A 301 redirect provides the ability to stitch together identical pages and automatically redirect the user from one URL to another, even if their content is different. For example, the main mirror can be tied to the user’s location. When entering an address for the Russian Federation, a user from Belarus will automatically switch to the Belarusian version of the resource.
You can merge mirrors with URLs in Cyrillic with addresses in Latin. Instead of Cyrillic text, you must specify the address in punycode format.