Please Advice: Want to edit functions.php to redirect registration page.

  • sghegde87

    #8027

    Hi,

    I am thinking of running a forum in my WordPress+Graphene powered website and I have created my own login page and registration page..

    For this purpose and also as a security measure, I want to redirect all the request that come to ‘wp-login.php’ and wp-login.php?action=register pages to go to /custom-login-page and /custom-registration-page.

    I did a lot of googling and may be my searching skills are not good enough but found only this solution to add in the functions.php file.

    add_action('init','possibly_redirect');

    function possibly_redirect(){
    global $pagenow;
    if( 'wp-login.php' == $pagenow ) {
    wp_redirect('http://infomandala.com/login-page/');
    exit();
    }
    }

    I did this and still it didnt work. 🙁

    Could you guys please advice what can be done for this issue?? Help is much appreciated.

    Reards,

    Shiva G

    Prasanna SP

    #40101

    How about redirecting using .htaccess?

    Prasanna SP

    #40102

    Something like,

    RewriteCond %{HTTP_HOST} ^infomandala.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www.infomandala.com$
    RewriteRule ^wp-login.php/?(.*)$ "http://infomandala.com/login-page/$1" [R=301,L]
Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.