I ran into an issue where users were getting an invalid SSL security certificate warning when visiting an “old” domain after we changed their website to use a new domain.
Both domains were in their Godaddy account, so I changed the new domain’s DNS to the proper A record, set the old domain to forward using Godaddy’s built in forwarding feature in their DNS, and set forwarding to use https.
In Cloudways, I changed the domain which is incredibly easy to do you. You don’t actually need to delete the old domain, you just simple type in the new domain and click save changes. It will change the URLs automatically for you in WordPress, so you don’t even need to make any tweaks in WordPress (except maybe if you have hard coded URLs that need to change).
My mistake and what actually triggered the SSL warning on the old domain was deleting that old domains in the SSL Certificate section of the Cloudways back end. When a user tried to visit the site but accessed the old URL, it couldn’t find the SSL certificate previously found there and it failed to forward on to the new URL.
The fix is simple: add all the domains to the SSL Certificate section in Cloudways as seen below and within a short time, assuming no other issues, your problem will be resolved and visitors will no longer see the SSL warnings.
As you can see, I used both non-www and www versions of both domains and this ensures the SSL certificate will apply, regardless of what variation of the URL is accessed. Be sure have a CNAME record for www set to @ so that the www forwarding works correctly as well.
Hope this helps you!