How to Create Conditional Redirects for Plan-Specific Pages Answered
Hello, please how can I redirect members on a specific plan (e.g. plan A) to the homepage if they land on the 'upgrade to plan A' page? I think the solution would be adding code similar to this but involving plan ids. Unfortunately this code from Rey did not work. Thanks
Comments
3 comments
Hey Heather B, just wondering if you have tried the Gated content settings instead for this. Say you gate the upgrade page, and allow access to this page only if the user is in a free plan?
The code below is the right code snippet to achieve that. Do well to replace the planIDs and redirect URLs where necessary.
A J thank you for the suggestion. Unfortunately it wasn't right for my use case I didn't want to gate the page from everyone not on plan B - i wanted people signed out to see the page too (and the gating method was redirecting them)
Chukwudi Onyekwere thank you for your help! I tweaked the code you provided slightly for the reason mentioned above and it works perfect! I'll leave it below in case anyone might want it.
thank you both again
Please sign in to leave a comment.