Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Caseproof

    (@caseproof)

    Hi @tonforum

    When you use private site feature, Members redirects you to default WordPress wp-login.php page, so I don’t understand why login form doesn’t work on that page. Could you double-check that WordPress and Site Address URLs in Settings > General section are the same?

    Best

    Thread Starter tonforum

    (@tonforum)

    Hi @caseproof

    Settings are the same “https://mySite.com/wordpress”

    I noticed that when I go to “https://mySite.com/wordpress” then it works instantly.

    Thread Starter tonforum

    (@tonforum)

    forget the &#8221.

    Plugin Author Caseproof

    (@caseproof)

    Are you on multisite installation? It looks like your site URL is set to https://mysite.com/wordpress/ but redirect URL in auth_redirect is set to https://mysite.com/. Please try to add the code snippet below at the end of your theme’s functions.php file:

    function redirect_user() {
      if ( ! is_user_logged_in() && members_is_private_page() ) {
        wp_redirect( 'https://mySite.com/wordpress/wp-login.php?redirect_to=https%3A%2F%2F2mySite.com%2Fwordpress%2F&reauth=1' );
        exit;
      }
    }
    add_action( 'template_redirect', 'redirect_user' );

    I hope it helps.

    Thread Starter tonforum

    (@tonforum)

    Hi @caseproof

    Thanks for your comment. I added your code to the active theme’s functions.php file, but it didn’t change anything.

    Plugin Author Caseproof

    (@caseproof)

    You can try to modify previous code like this to execute it before other redirects:

    function redirect_user() {
    if ( ! is_user_logged_in() && members_is_private_page() ) {
    wp_redirect( 'https://mySite.com/wordpress/wp-login.php?redirect_to=https%3A%2F%2F2mySite.com%2Fwordpress%2F&reauth=1' );
    exit;
    }
    }
    add_action( 'template_redirect', 'redirect_user', 1 );

    If that doesn’t work, please deactivate all your plugins temporarily except MemberPress to see if this resolves the problem. If this works, re-activate all plugins one by one to see which one causes that issue. You can also switch the current theme to the default WordPress theme temporarily and see if this helps.

    • This reply was modified 1 year, 11 months ago by Caseproof.
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Whole Site Private (Members by MemberPress), Wrong initial login url’ is closed to new replies.