With www or without?
Definition of the main mirror for Yandex.
In order for Yandex to glue both mirrors, he needs to specify the domain of the main site in the HOST directive.For example, if you want to show that your primary domain is http://www.site.ru , then the robots.txt file will look like this:
User-agent: Yandex
Disallow:
Host: www.sitename.ru
User-agent: *
Disallow:
Sitemap: http://www.sitename.ru/sitemap.xml
User-agent: Yandex
Disallow:
Host: www.sitename.ru
User-agent: *
Disallow:
Sitemap: http://www.sitename.ru/sitemap.xml
HOST directive is intended exclusively for Yandex, so it is not superfluous to prescribe (duplicate) the necessary directives for the robots of other search engines. Definition of the main mirror for Google.
To determine the main mirror for Google, do the following step-by-step:1. Register the site in the Google Webmaster Tools service .
2. Having studied the instructions, confirm the rights to manage the site;
3. Select the following item in the menu "Site Configuration-> Settings-> Primary Domain" and tick the box next to the required domain.
Use of 301 redirects.
In order to show the search engines that your site is http://site.ru/ - the main site, write the following lines in the technical file .htaccess , located in the root directory of the site:RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)(.*)$
RewriteRule ^(.*) http://%2/$1 [R=301,L]
RewriteCond %{HTTP_HOST} !^(site\.ru)$
RewriteRule ^(.*) http://site.ru/$1 [R=301,L]
RewriteRule ^robots.txt$ - [L]
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)(.*)$
RewriteRule ^(.*) http://%2/$1 [R=301,L]
RewriteCond %{HTTP_HOST} !^(site\.ru)$
RewriteRule ^(.*) http://site.ru/$1 [R=301,L]
RewriteRule ^robots.txt$ - [L]
In order to show the search engines that your site is http://www.site.ru/ - the main site, write the following lines in the technical file .htaccess : Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^site.ru
RewriteRule ^(.*)$ http://www.site.ru/$1 [R=301,L]
Comments
Commenting on, remember that the content and tone of your message can hurt the feelings of real people, show respect and tolerance to your interlocutors even if you do not share their opinion, your behavior in the conditions of freedom of expression and anonymity provided by the Internet, changes Not only virtual, but also the real world. All comments are hidden from the index, spam is controlled.