Support » Fixing WordPress » BP Suffusion S2Member = Login Redirect Madness

Viewing 7 replies - 1 through 7 (of 7 total)
  • Update:

    Hmmm, I have a test site which has only wp and bp installed, and when i go directly to the wp-login.php login form, the redirect_to field is set to “” which makes a LOT more sense.

    So the question now becomes, who’s setting the redirect_to to be wp-admin on my main site.

    First culprit is Suffusion since I don’t have suffusion on my test site. Off to their forums to ask…… stay tuned……

    Update: I posted this problem over at the Suffusion forum and they say that suffusion isn’t the culprit. So still can’t figure out who’s introducing the redirect to wp-admin in my login form. Gonna ask in the S2Member forum next.

    S2Member forum also says they do not override redirect_to unless there’s no redirect in form.

    I have deactivated all plugins and reverted to the twentyTen theme and see some interesting results.

    for my www domain, which is installed at the top directory of the public_html directory, I continue to see the login form having the redirect_to hidden form field wp-admin redirect as a hidden form field set to the address of the wp-admin page.

    But for my test subdomain, which I have installed in a /test subdirectory, the login form has a redirect_to variable set to “” in the form field.

    I have no idea why this is. Ideally I would uninstall, delete everything and reinstall to see if it’s truly just the location of the install that makes the difference. But I don’t have time to test out that theory.

    For now I’m just going to assume that I have to hard-code the redirect_url on all URLs to the login form. Otherwise the user will be redirected to a page they don’t have access to.

    This might be easy for you to resolve. If you look at the core WP code, you will notice that redirect_to is set to the admin_url in case one is not specified. Since you want to override that, you can try using the login_redirect filter hook. The core code has:

    $redirect_to = apply_filters('login_redirect', $redirect_to, isset( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '', $user);

    So if you add some code to your child theme to force a different URL you should be fine. The $user variable above will tell you which user is being logged in, so you can pick that user’s profile.

    Hello Sayontan, I too am new to WP and am trying to work through these redirects. Can you be more specific about where the filter hook is placed and how to locate the setting for “redirect_to”?

    I am having this exact problem with those plugins as well (BP, Suffusion, S2Member) and through testing determined it was BuddyPress handling the redirect issue.

    I had originally set up a “Member Home” section that S2Member used to redirect to but once I installed BuddyPress it no longer worked.

    I tried to set up some custom code in bp-custom.php from just to see if I can redirect anywhere but it did not work.
    /*let us filter where to redirect */


    function bpdev_redirect_to_profile($redirect_to_calculated,$redirect_url_specified,$user)

    /*if the user is not site admin,redirect to his/her profile*/
    return bp_core_get_user_domain($user->ID );
    return $redirect_to_calculated; /*if site admin or not logged in,do not do anything much*/

    Hoping for one last shot, otherwise it seems I may have to try:
    If I did this, would I just edit wp-login.php?



    I have a similar problem. After disabling Theme My Login, all s2member redirect returns 404 error. IT seems like there’s an additional %2F, %3F etc at the links:

    I’m really messed up with this since it is a running site.

    My code for logout is this:

    <a href="<?php echo wp_logout_url(urlencode($_SERVER['REQUEST_URI'])); ?>">Log Keluar</a><br />


Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘BP Suffusion S2Member = Login Redirect Madness’ is closed to new replies.