• Resolved halben

    (@halben)


    I added this to the theme’s function.php. I log onto the website and click on login, it still takes me to the default WP login screen.

    /*
     * Newly added custom code (for reference only)
     * --------------------------------------------
     * RedirectWPLogin()
     * Redirect from default WordPress login to custom login page
     */
    
     add_filter('init', 'RedirectWPLogin()');
     function RedirectWPLogin()
     {
     	$request = basename($_SERVER['REQUEST_URI']);
    	if ($request == 'wp-login.php'):
    		wp_redirect(site_url('/login'));
    		exit();
    	endif;
     }

    Can anyone please help me in debugging this problem?

    Thanks,
    Hal

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Redirect from default WP to custom login page not working, here's the script’ is closed to new replies.