This can be used on both when a site is transferred to a new domain or from a staging URL
Many occasions you need to push for an https URL (SSL) – here’s how we can do it using .htaccess
RewriteEngine On RewriteRule (.*) http://url.to.new.location/$1 [R=301,L]
You can leave the old copy of files there and this should ensure visitors don’t see things from there anyways.