Page 1 of 1

Login Redirection Problems

PostPosted: March 15th, 2011, 2:38 pm
by Jason Caldwell
As of s2Member v3.5+, the only way to override s2Member's Login Welcome Page redirection is through the application of a hidden input field with the name: redirect_to ( a WordPress standard ). Some login widgets will use the special redirect_to variable ( passing its value to your /wp-login.php handler ). s2Member must always obey that parameter when it is passed through.

For example, this will override s2Member's Login Welcome Page redirection:
Code: Select all
http://www.yoursite.com/wp-login.php?redirect_to=http://www.yoursite.com/page2/

If you're having trouble, you might be using a theme or plugin that is passing the redirect_to variable, and thereby forcing a redirection to a pre-determined URL on your site. Either that, or you may have a plugin that is attempting to compete with s2Member in some way that is ultimately creating a conflict.

Please start by attempting to log into your site as a Level #1 Member, from the default location:
Code: Select all
http://www.yoursite.com/wp-login.php

If that does NOT redirect you to the Login Welcome Page, try disabling other plugins until it does. This will help you find the culprit. If you find the culprit, please try to report back so we can have a closer look. It might be something we can help you with; making it possible for the two plugins to co-exist.

If disabling all plugins does not work, try using the default Twenty Ten theme.



Another important note. If you're running the s2Member Pro Login Widget, please remember that the Pro Login Widget has it's own set of options to control login/logout redirection. You can re-configure the Pro Login Widget in your Dashboard under: Appearance -> Widgets -> s2Member (Pro) Login Widget.

Re: Login Redirection Problems

PostPosted: March 15th, 2011, 2:44 pm
by Jason Caldwell
If you WANT to allow another plugin to override s2Member's login redirection.

Create this directory and file:
/wp-content/mu-plugins/s2-hacks.php

Inside the file, add this code:
Code: Select all
<?php
add_action 
("plugins_loaded", "allow_s2_redirection_overrides");
function allow_s2_redirection_overrides ()
    {
        remove_action ("init", "c_ws_plugin__s2member_login_redirects_r::remove_login_redirect_filters", 11);
    }
?>

* s2Member was updated in the latest release to prevent redirection overrides, because s2Member provides comprehensive options for this under: `s2Member -> General Options -> Login Welcome Page`. Many site owners were experiencing issues with login redirection, particularly in BuddyPress. These problems were associated with login redirection being overwritten by other themes/plugins. Therefore, as of s2Member v3.5+, if you actually *want* to allow overrides by other plugins, you will need to remove s2Member's protection against this, by implementing the code I've given above.

Re: Login Redirection Problems

PostPosted: July 3rd, 2011, 4:56 am
by webcamtalk
When I tried the code, I get the following error

Warning: Cannot modify header information - headers already sent by (output started at /home/webcam/public_html/wp-content/mu-plugins/s2-hacks.php:1) in /home/webcam/public_html/wp-includes/pluggable.php on line 897

Ideas?

Re: Login Redirection Problems

PostPosted: July 3rd, 2011, 12:40 pm
by Cristián Lávaque
Make sure there isn't a single thing outside the PHP tags, not even spaces or empty lines.

Re: Login Redirection Problems

PostPosted: July 3rd, 2011, 1:03 pm
by Jason Caldwell
Cristián Lávaque wrote:Make sure there isn't a single thing outside the PHP tags, not even spaces or empty lines.
I agree. Sounds like you have blank lines or spaces, either before or after the PHP tags.

Re: Login Redirection Problems

PostPosted: July 13th, 2011, 12:50 pm
by greaterlight
I have a question along these lines. I am sure I am over thinking it but…..

I installed WordPress in a sub folder of the domain in question and placed an index.php at the root.

Now, I can definitely redirect my URL from www.domain.com to www.domain.com/site/wp-login.php but that still leaves the "site" folder unprotected. Meaning, someone can easily backspace to that location and access the site without login in or subscribing.

What is the best way to handle this?

Re: Login Redirection Problems

PostPosted: July 13th, 2011, 10:01 pm
by Cristián Lávaque
At the moment, using s2Member you can only restrict access to content served by WordPress. You could try to include wp-load.php to a page outside WordPress and, in effect, make it run WordPress there, which would allow you to at least use s2Member's URI Access Restrictions. WP Admin -> s2Member -> Restriction Options -> URI Access Restrictions

Re: Login Redirection Problems

PostPosted: July 15th, 2011, 7:38 pm
by greaterlight
Thanks. I couldn't get that to work so what I ended up doing was just placing a 301 re direct at the server level.

Re: Login Redirection Problems

PostPosted: August 12th, 2011, 7:32 pm
by NicoleJolie
Hi! I have a question:

In the first video Jason goes over he tells us to make two pages a Login Welcome Page and a Membership Options Page.

1.What's the default template for both of these pages we should be securing?

My login redirection isn't working, but I know that's a 'user error' not an S2 error. I keep working on it....

Are we allowed to put our websites in here for people to test? Want to make sure before I'm banned for doing something really stupid.

Nicole

Re: Login Redirection Problems

PostPosted: August 12th, 2011, 10:07 pm
by Cristián Lávaque
Hi Nicole. No problem posting a link to the page you need help with if you don't mind showing it. Those pages can have anything you want.