Simple Membership Plugin › Forums › Simple Membership Plugin › Redirect if not logged in
- This topic has 3 replies, 2 voices, and was last updated 10 years, 3 months ago by
mbrsolution.
-
AuthorPosts
-
May 5, 2016 at 2:37 pm #6819
andy_sdc
ParticipantI am working through configuring the simple membership plugin (and add-ons) to protect the support section of our website. Most of it is now working but I think I am having a bit of a dim moment…
I have a page that is set to be protected that has the URL http://myurl/support-home/ which works as it is expected to when the user is logged in. If I go to that URL without being logged in then I just see my WP theme with nothing showing in the body of the page.
If someone accesses the URL directly and they aren’t logged in how do I redirect them to the login page?
TIA
Andy.
May 6, 2016 at 8:07 am #6822mbrsolution
ModeratorHi Andy, I am not sure what you mean by the following comment.
If someone accesses the URL directly and they aren’t logged in how do I redirect them to the login page?
Is the above comment referring to the URL that you can’t see the content if you aren’t logged in? Is this URL part of your website? Did you also add protection to this URL?
May 6, 2016 at 10:06 am #6826andy_sdc
ParticipantHello,
Let me see if I can explain this better… We are trying to use the plugin to force users to login to the technical support section of our website so that we only get support tickets from real customers all of whom will be in the only defined membership level (support users).
The start page for the support site is <my_website_url>/support-login/ which contains some text and the short code [swpm_login_form]. The “support users” membership level has the “after login redirection page” option set to <my_website_url>/support-home/ so that on a successful login they go to the real support page which is protected and only available to members of “support users”.
If I bookmark the <my_website_url>/support-home/ page and go back to it later when I am not logged in the browser shows me the header and footer from my WordPress theme but with nothing between them. At the very least I need it to show a message that says “To login to the support site click here…” or better still redirect automatically to the login page.
Andy.
May 7, 2016 at 12:43 am #6829mbrsolution
ModeratorIf you type the following <my_website_url>/support-home/ into your browser and it does not display anything, do you have a cache plugin installed? If you do have a cache plugin, is it configured correctly? Can you also clear the plugin cache if you have one.
Is this page also protected? Are you using a custom template? If you clear your browser cache and try again will it work?
-
AuthorPosts
- You must be logged in to reply to this topic.