📜 ⬆️ ⬇️

Correct transition from the old domain to the new one

Good day.
I want to share my experience in transferring a site to a new domain while retaining all the parameters of the old one.

Task

There is a site.com domain with certain indicators of TIC and PR, but we want to transfer the project (website) to a new address without losing the already received blood and then results in search engines.

Decision

Make an .htaccess file on the old site.com domain, containing:
')
Options +FollowSymLinks RewriteEngine on RewriteCond %{REQUEST_FILENAME} robots.txt$ [NC] RewriteRule ^([^/]+) $1 [L] RewriteCond %{HTTP_HOST} ^site\.com RewriteRule ^(.*)$ http://site.org/$1 [R=301,L] RewriteCond %{HTTP_HOST} ^www.site\.com RewriteRule ^(.*)$ http://site.org/$1 [R=301,L] 


Note: All users and search engines will be redirected from site.com and www.site.com to site.org, Google will accept this and after about 2 months the PR figures will go to site.org.

It remains to remember to transfer the TIC, for Yandex the transfer algorithm is a bit more complicated. He still needs robots.txt. There are a lot of webmasters who make a mistake , they make a 100% redirect from domain to domain, forgetting that you need to leave Yandex robots.txt for this and you need a line:
RewriteCond% {REQUEST_FILENAME} robots.txt $ [NC]

Robots.txt content:
 User-agent: Yandex Host: site.org User-agent: * Disallow: Sitemap: http://site.org/sitemap.xml 


Now you can be sure that TIC indicators will move to a new domain.
Thanks for attention.

Source: https://habr.com/ru/post/168471/


All Articles