Hello,
I have a rewrite rule that moves the loginpage to a different slug to block bot attacks on wp-login.
Wp-login redirects to the homepage. This is not a problem when I resave the permalinks.
The problem is that after migration from staging to live the permalinks and the rewrite rules seem to be broken until I resave the permalinks.
That is not possible unless I ssh into the server and comment out the redirect for the default wp-login page. After saving the permalinks my /custom-login works again. How can I avoid this issue?
This is a snippet of the code in my functions.php:
add_action(‘updraftplus_restore_completed’, ‘flush_after_restore’);
function flush_after_restore()
{
flush_rewrite_rules();
}
// Hide login
add_action(‘init’, ‘custom_login_page’);
add_action(‘init’, ‘custom_login_rewrite_rule’);