Page 1 of 1

Restricted area redirect to blank page for free members

PostPosted: December 5th, 2011, 7:27 pm
by tourdecartes
Hello,

I could see that when a free member is trying to access a restricted area, he is redirected to a blank pas with this url: http://www.mydomain.com/abonnements?_s2 ... evel_req=1

I would like them to be redirected to the membership option page so they can upgrade but it wont work.
However I can see that when a visitor is not registered at all, the redirect works like a charm.

Anyone would have an idea why that is and how can i make it right again?

Thanks again for the help :)

Manu


PS: A huge thanks to the team and everyone who help out by the way! This is just the best plugin!

Re: Restricted area redirect to blank page for free members

PostPosted: December 5th, 2011, 10:36 pm
by Eduan
Did you set the page so that it requires a certain level?
And are you logging out of your admin account before doing the test?
I suggest you make a new user with a certain user level and try logging in as that user.

Hope this helps. :)

Re: Restricted area redirect to blank page for free members

PostPosted: December 6th, 2011, 1:14 am
by tourdecartes
Hello Eduan,

Thanks for taking the time to answer.

Yes the page is level 1 and i tried to access a level1 post with my test account level 0 (free). I was expecting to be redirected to the member option page to a able to upgrade but instead i had a blank page.
The thing is the redirect works if im not logged in into any account at all...

Re: Restricted area redirect to blank page for free members

PostPosted: December 6th, 2011, 5:03 am
by epixmedia
Hi tourdecartes, you could try placing some text between this shortcode in your page, like so:
[s2If !is_user_logged_in()]
Some public content. They're NOT logged in.
A leading !exclamation means false.
[/s2If]

This would only show to users that are not logged in and could contain links that take them to the login and/or registration pages.

Its odd its not redirecting though as mine does... Have you set you registration default page in the s2member settings?

Re: Restricted area redirect to blank page for free members

PostPosted: December 6th, 2011, 9:17 am
by Eduan
The code that epixmedia showed you can be found under WP Admin -> s2Member -> API / Scripting -> Simple/Shortcode Conditionals.

Also, that code doesn't redirect the user if he's logged out, it just doesn't show the content if the user doesn't have the right level, so they would see a blank page.

These shortcodes are usually used on the Membership Options Page / Login Welcome Page so that users get different content based on their level.

Have you set everything that has to do with s2Member under WP Admin -> s2Member -> General Options? If not everything please do and tell us how it goes.

Hope this helps. :)

Re: Restricted area redirect to blank page for free members

PostPosted: December 6th, 2011, 12:42 pm
by tourdecartes
Hello,

The issue is fixed! It was created by the "Secure WordPress" plugin.
Apparently it was considering the request as a bad query and was just blocking it.
I just deactivated the "Secure WordPress" plugin and everything went back to normal.

Thanks a lot for your time, your help was really appreciated!

Emmanuel

Re: Restricted area redirect to blank page for free members

PostPosted: December 6th, 2011, 1:02 pm
by Eduan
OK, glad it works now.

Re: Restricted area redirect to blank page for free members

PostPosted: February 2nd, 2012, 10:12 pm
by emvaughn
Just FYI Emmanuel,

There is a setting in Secure Wordpress that you can uncheck to fix the issue. If it was a plugin you wish to keep using simply uncheck the option that says, "Block bad queries - Protect WordPress against malicious URL requests." I ran into the same issue!