There are many ways to redirect from a staging site to the live site. In this example I will show you how to do it using an MU plugin.
You'll need to edit the target site shown in the snippet below and then create a file in the specified directory.

Since this is an MU plugin it doesn't need to be specifically activated and therefore those who have access to the site via FTP can remove it.
The closing php tag is intentionally omitted so there is no whitespace inserted accidentally.

wp-content/mu-plugins/my_custom_deactivator.php

[code]
<?php

add_action('plugins_loaded', 'my_custom_deactivator_redir2live');

function my_custom_deactivator_redir2live() {
    header('Location: http://youmainsite.com', true, 301);
    die;
}
[/code]

 

Disclaimer: The content in this post is for educational purposes only. Always remember to take a backup before doing any of the suggested steps just to be on the safe side.
Referral Note: When you purchase through a referral link (if any) on this page, we may earn a commission.
If you're feeling thankful, you can buy me a coffee or a beer