So you’re updating domains, but what about your search rankings? I just did this myself and it wasn’t as hard as I expected.
Disclaimer, if you need help, read .htaccess file and SSH setup.
HTACCESS File
If you’re running a Content Delivery Network (CDN), turn off caching. For example, Cloudflare Dashboard > turn on development mode.
Next, connect to your server via SSH.
ssh <username>@<ip>
nano .htaccess
- Copy the text below, replace the placeholder text.
- Exit nano and save file,
CTRL + X
>Y
>ENTER
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^olddomain.com$
RewriteRule (.*)$ <https://newdomain.com/$1> [R=301,L]
</IfModule>
Done, you’ve added code to force the redirect of your new domain on all web pages.
WordPress
Now reflect the new domain in WordPress.
Go to, Settings > General > WordPress Address (URL), Site Address (URL) and add your new domain to either both fields or site address.
Easy as, that’s it for WordPress.
Cloudways
Now the server and WordPress application know about the changes, it’s over to your web host.
- Cloudways > Application Management > Domain Management
- Update Primary Domain to New Domain
If you’re stuck, reach out to the Cloudways support team, they’re super helpful. If you host with another provider, check their documentation for these steps.
Search Engines
Lastly, to ensure your precious Search Rankings stay as they are, update your desired Search Engine Consoles.
- For Google, Search Console > select your old domain.
- Go to Settings > Change of address
For more see How do I safely move or migrate my website to a new domain name?
Now repeat this for the other search engines such as Bing… or don’t. Hope this was helpful.