Plesk offers you a handy way to preview the site before you switch over the DNS, called Websites Preview.
This is what it does:
customer-site.tld will be available for preview as customer-site.tld.192-0-2-12.your-domain.tld. Here 192-0-2-12 is the site’s IP where dots are replaced with dashes
I find this feature very useful, as we use it for proofing websites before they go live, however after the site goes live the customer-site.tld.192-0-2-12.your-domain.tld
URL still exists, and is showing up in some Google results!
How can I remove the preview URL for certain sites only, not for all sites on the server?
Alternatively I think I may be able to use a .htaccess rule for this, but I cannot figure out how to do that without a redirect loop.
2
Answers
I found the answer to this with some more searching (I searched for how to redirect domain alias, as that's what this essentially is).
The answer is here: Redirecting all domain aliases to one with htaccess
Use robots.txt file to prevent crawlers from indexing your page. After you have done DNS switching, remove robots.txt file