A
A
Andrew2018-05-26 15:12:51
htaccess
Andrew, 2018-05-26 15:12:51

How to make a 301 redirect when moving to a new domain?

Hello! There are two domains servicelap.ru and servicelap.info, both domains belong to me. Transferred the entire site to .info, and deleted all files on .ru, leaving only htacsess. What rule should be written so that if people go from a search to the .ru domain, they are automatically redirected to .info. for example www.servicelap .ru /remont-dell/ to www.servicelap .info /remont-dell/
Domain with .ru in Yandex index 8000 pages.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
RigidStyle, 2018-05-26
@RigidStyle

Just replace one domain with another with full preservation of the subsequent request, and make a 301.
https://web-optimizator.com/301-redirekt-htaccess/ point 15.

RewriteCond %{REQUEST_URI} (.*)
RewriteRule ^(.*)$ http://site.ru/$1 [L,R=301]

Since if you just pour the entire old site on the main one, you will lose all SEO.
And of course, in the settings of the search consoles, set the site relocation.

V
Viktor Taran, 2018-05-27
@shambler81

RewriteCond %{HTTP_HOST} ^(www\.|)servicelap\.ru$
#если сайт с ввв и без
RewriteRule ^(.*)$ http://www.servicelap.info/$1 [L,R=301]
#То перенаправить на домен, скопировав весь урл

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question