PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

Login Redirection Problems

Common Questions/Problems/Tips. Posted by Administrators & Support Reps.

Login Redirection Problems

Postby Jason Caldwell » March 15th, 2011, 2:38 pm

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.
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Login Redirection Problems

Postby Jason Caldwell » March 15th, 2011, 2:44 pm

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.
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Login Redirection Problems

Postby webcamtalk » July 3rd, 2011, 4:56 am

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?
User avatar
webcamtalk
Registered User
Registered User
 
Posts: 1
Joined: July 3, 2011

Re: Login Redirection Problems

Postby Cristián Lávaque » July 3rd, 2011, 12:40 pm

Make sure there isn't a single thing outside the PHP tags, not even spaces or empty lines.
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Login Redirection Problems

Postby Jason Caldwell » July 3rd, 2011, 1:03 pm

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.
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Login Redirection Problems

Postby greaterlight » July 13th, 2011, 12:50 pm

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?
User avatar
greaterlight
Registered User
Registered User
 
Posts: 2
Joined: July 13, 2011

Re: Login Redirection Problems

Postby Cristián Lávaque » July 13th, 2011, 10:01 pm

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
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Login Redirection Problems

Postby greaterlight » July 15th, 2011, 7:38 pm

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.
User avatar
greaterlight
Registered User
Registered User
 
Posts: 2
Joined: July 13, 2011

Re: Login Redirection Problems

Postby NicoleJolie » August 12th, 2011, 7:32 pm

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
User avatar
NicoleJolie
Registered User
Registered User
 
Posts: 1
Joined: August 12, 2011

Re: Login Redirection Problems

Postby Cristián Lávaque » August 12th, 2011, 10:07 pm

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.
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010


Return to Common Questions/Problems/Tips

Who is online

Users browsing this forum: No registered users and 2 guests

cron