Redirecting to the previous protected page after login

OK, I know there have been plenty of posts regarding this subject, but for some reason it’s still not working for me. When a user tries to access a protected page she gets redirected to the MOP page. After she signs in she’s supposed to be redirected back to the protected page. But she’s being sent to the Login Welcome Page. What am I doing wrong?

I’m using the s2member pro Login Widget and I set the “Redirection After Login” to “Previous Page”.

I also have set the s2Member>General Options> Login Welcome Page to the correct page.

And I’ve set up the Membership Options Page correctly

And finally I set up members to be redirected from the default Wordpress profile page.

Thank you

Hi Alto.

Yeah, it’s not exactly what you are trying to do… “Previous Page” on login would bring the person back to the page he logged in from. In your example that’d be the Membership Options Page, but what you’re trying is to get him back to the page that redirected him to the MOP page, right?

You need to get from the MOP vars the page that he tried to access, and then use that page’s address for the redirection after login. If you link to wp-login.php, for example, you’d add it to the query string as, if I remember correctly.


I hope that helps. :slight_smile: