Answer the question
In order to leave comments, you need to log in
Help with redirecting to a new website domain?
Good afternoon friends! Thank you for your help because I am in this business for the first time and in general I am not doing this in principle.
Essence of the question: It is necessary to set up a 301 redirect from 1 site (well, it's easy, from www to regular and without). But, how can I transfer the positions of the site? An online store of one production is being transferred. Well, as it were, it’s also easy here, We prescribe Redirect 301 /catalog/price_1 site.ru/catalog. Everything works, but it doesn’t work (I don’t know) how to make a redirect from domain to domain while maintaining site position redirects. One thing works, either transferring a domain or a position, together in no way. Thank you )
#RewriteCond %{HTTP_HOST} ^site1\.ru$
#RewriteRule ^(.*)$ stie2.ru/$1 [R=301,L]
#RewriteCond %{HTTP_HOST} ^www\.(.*)$
#RewriteRule ^(.*)$ site2.ru/$1 [L,R=301]
Answer the question
In order to leave comments, you need to log in
Thanks Dmitry for the tip.
Create a script at the root of the old site
Send all requests to it
$ref = $_SERVER['QUERY_STRING'];
$ref == '' ?: '?' . $ref;
header('HTTP/1.1 301 Moved Permanently');
header('Location: newdomain.com ' . $ref);
exit();
Well, in general, you need to read about flags in hitachi
https://httpd.apache.org/docs/2.4/rewrite/flags.html
Written 23 hours ago
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question