Home › Forums › Community Forum › Redirect Question
This topic contains 11 replies, has 4 voices. Last updated by Jason (Lead Developer) 4 years, 10 months ago.
Topic Author | Topic |
---|---|
Posted: Saturday Feb 18th, 2012 at 8:27 am #5575 | |
|
|
I have three levels of membership. When a member tries to access content not available to their level, I want to redirect them to the login welcome page instead of the membership options page. How do I do this? |
List Of Topic Replies
Author | Replies |
---|---|
Author | Replies |
Posted: Saturday Feb 18th, 2012 at 12:31 pm #5589 | |
|
|
Hello Carl, thanks for your inquiry. Currently this is not possible by default with s2Member, without some tricks. ;) (No coding involved.) First, go to WP Admin -> s2Member -> General Options -> Login Welcome Page. In there, leave the field to select the page empty, and under that you will see a field that goes something like “Or, you may configure a Special Redirection URL, if you prefer.”, or something along those lines, in there, paste the full URL of the Membership Options Page that you wish to use. Now, under WP Admin -> s2Member -> General Options -> Membership Options Page select the page that you wish to use as the Membership Options Page. Please tell me how it goes, and I hope this helps. :) |
|
Posted: Saturday Feb 18th, 2012 at 12:52 pm #5590 | |
|
|
Thank you for your response. I’m not sure I understand, however. The solution you suggested seems like it would still redirect members who try to access content that is restricted by their level to the membership options page. For example, when a level one member who is logged in tries to access a level three area, it redirects them to the membership options page. I want it to redirect them to the login welcome page, not a signup page. |
|
Posted: Saturday Feb 18th, 2012 at 1:09 pm #5595 | |
|
|
Hello Carl, thanks for the follow-up. Yes I’m sorry, it seems I misunderstood a little, you will configure both of these options to point to the Login Welcome Page, not the Membership Options Page. It should look something like this: Hope this helps. :) |
|
Posted: Saturday Feb 18th, 2012 at 3:56 pm #5611 | |
|
|
Okay, I think we might be closer, but I still want people who are not members to be redirected to the membership options page. Won’t this affect that? |
|
Posted: Saturday Feb 18th, 2012 at 4:18 pm #5613 | |
|
|
At the base, when a member is not logged in, s2M cannot say whether they are supposed to be a level 1 or level 3 member or not a member at all, so unless the member IS logged it, i dont think s2M will know to direct them to a different page.
|
|
Posted: Saturday Feb 18th, 2012 at 4:40 pm #5617 | |
|
|
I think maybe the problem is that I am just not stating it very well. Let me try again. When someone visits my site who is not a member, they get redirected to the membership options page. In other words, the only content they will see until they sign up is that page. This is fine. That’s where I want them to go so they can sign up. When a member is logged in and browsing my site and they try to access content that is restricted (example: a Level 1 member attempts to access a Level 3 page) they also get redirected back to the membership options page. This is not fine. I either want them to see the welcome page or a page which says Your membership level does not allow you to access this page. Maybe that makes more sense. I know there has to be a way to do this. Having someone who is already a member getting redirected back to the membership options page is just sloppy. |
|
Posted: Saturday Feb 18th, 2012 at 4:52 pm #5618 | |
|
|
I have that sort of redirect on my site. I have two sales pages and if someone already has purchased those courses (and they are logged in), they are redirected to the index of that course. Maybe this can help you? window.location = ‘http://scrapbookcampus.com/welcome-to-the-basic-scrapping-course/’; I am not using levels in my site, but just ccaps, but it is the same principle. In this example, Then, i also put the “matching” code in the course index page, in case someone would find the direct link to it, and tries to access it without the proper requirement. BTW, the mention of the administrator is a great little detail to add so that you, as an admin, CAN view either page and NOT get redirected whichever page you want to view (essential when you are formatting your page!). Hope this helps. |
|
Posted: Saturday Feb 18th, 2012 at 5:00 pm #5619 | |
|
|
Well, that is definitely more info than I had. I appreciate your time and effort in making that response. So, what you’re telling me is that I’m going to have to code this. Ccap, etc….Greek to me. Great. It does disappoint me that S2Member cannot provide a simpler method to redirect members/non-members. That is basically all I want to do. Non-paying members see the Membership Options Page….Paying members see the Welcome Page on a redirect. That seems like something S2Member could have incorporated very easily without all this need for coding. |
|
Posted: Saturday Feb 18th, 2012 at 5:25 pm #5621 | |
|
|
I actually realized that i didn’t enclose the code in a code format so what i showed you didn’t display correctly. It was supposed to be this:
S2M is very powerful and the ccaps is one of the most powerful feature, combined with the conditionals. I am NOT a developper, and i am NOT a coder (even HTML is foreign language for me). The logic is very simple, and the coding, once you have it, is also simple. There is a video explaining the use of the conditionals here: The ccap is not necessary for you if you are using levels. In my site, it is just not what i need. So, to recapitulate, here is what you might be looking for: on your level 3 page, you can add something like this on top
Which simply translates: Check the API /Scripting > Advanced/PHP conditional for many examples. It looks like jibberish at first, trust me, but when you know how it works, it gives you much more flexibility than any “simple” button possibly built in the s2M itself.
|
|
Posted: Saturday Feb 18th, 2012 at 5:32 pm #5623 | |
|
|
OK, there seems to be a big problem is displaying the code as i am typing it. It is NOT looking like it did when i typed it, nor when i previewed it. Let’s hope someone can figure out how to display my code properly. If not, i’ll send you a message, ok? I cannot even find a way to send you a direct message with this new board. I’ll look around for that. The redirect is very simple and so are the conditionals. It is just like algebra: simple basics but you can make it as complicated as you want after!
|
|
Posted: Monday Feb 20th, 2012 at 6:54 pm #5749 | |
|
|
Thanks for the heads up on this thread.
I would recommend using s2Member’s MOP Vars to handle this. If you look in your Dashboard under: |
This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.