A
A
Anton2015-12-13 22:49:33
WordPress
Anton, 2015-12-13 22:49:33

How to correctly implement a 301 redirect after a domain change?

There is a site on Wordpress, went through the process of changing the domain name to another. I want to transfer all site metrics to a new domain. In htaccess, I wrote rules for 301 redirects. The redirect happens from the old domain to the new one. But if you follow the old link from the Internet, then the link in the browser remains with the old domain, even though the content is pulled. It turns out that someone who visits the old links in the browser sees the old domain, someone who visits the new one sees the new home. Tell me is it okay? And then it turns out like two different sites with the same content.
.htaccess file code:
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
Options +FollowSymLinks
RewriteCond %{REQUEST_FILENAME} robots.txt$ [NC]
RewriteRule ^([^/]+) $1 [L]
RewriteCond %{HTTP_HOST} ^old\.com
RewriteRule ^(.* )$ new.me/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^www.old\.com
RewriteRule ^(.*)$ new.me/$1 [R=301,L]
# END WordPress

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
litvin2, 2015-12-16
@litvin2

So there are a million articles on the Internet, how to do this, why ask a typical question here?
http://devaka.ru/articles/redirect-301
wildo.ru/301-redirekt
www.pixelplus.ru/studio/stat/kak-sdelat-301-redirekt

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question