Memberships – redirect loop on translated pages

We seem to be getting a redirect loop relating to the translated versions of our M2 pages – we are using WPML for the translations.

  • BizE
    • Site Builder, Child of Zeus

    Hi Kasia

    What redirect loop did you find?

    I am now unable to reproduce mine – previously, if when logged out you tried to access a restricted page (eg. Membership-List), with the English URL “mysite.com/membership-list/”, you were correctly redirected to the “restricted content” page. But you tried either “mysite.com/us/membership-list/” or “mysite.com/ec/membership-list/” for our translated versions, you got a redirect loop.

    Now however, when you try to access any of these, you get our “404 page” not the “Restricted Content” page – confusing but is this how it should be- ie. that the “Restricted Content” page only only shows for logged in users?

    Thanks,

    Paul

  • BizE
    • Site Builder, Child of Zeus

    Update on last note;

    1. I have just logged in as an English registered user (but non-member) to the English language site

    2. Then tried to access a protected page (English) and got the Restricted Content Page – ok

    3. Then tried to access same, but US version of protected page – and got the Redirect Loop.

    Obviously, I understand that it would be unusual for a user to switch languages, but still wonder if this is needs a fix?

  • BizE
    • Site Builder, Child of Zeus

    Have now tested this another way which you can replicate;

    You have our domain name and if you try to access this English version of a restricted page “ourdomain/prize-game/” – you will correctly get the “Restricted Page”

    Then try to access the US version of the restricted page “ourdomain/us/prize-game/” – and you will get the Redirect Loop.

    Only thing I can think of is that in M2 Settings, you can only select the main domain (ie English) Restricted Page and are unable to set other language versions?

  • Kasia Swiderska
    • Support nomad

    Hello BizE,

    I’m sorry for confusion earlier – I meant there was no redirect, that’s why I asked about the steps.

    However I still can’t see redirects – page membership-list is not protected, and when I tried as non logged user to get to account page switching the languages didn’t redirect me.

    What exact page is protected?

    Kind regards,

    Kasia

  • Rupok
    • Support Ninja

    Hi Paul

    I hope you had a wonderful day.

    You are getting 404 on this url (http://yoursite.com/us/membership-list/) because, most probably there is not page at this link. I tried to visit http://yoursite.com/membership-list/ but it is also showing 404 which means the page is not there.

    But whenever I’m trying to access this URL (http://yoursite.com/us/prize-game/), yes, it is giving us a redirect loop.

    I can see some past issues with WPML with membership, but this one is completely new. So I need to be confirmed from which plugin, the problem is being generated.

    Would you mind allowing support access so we can have a closer look at this?

    To enable support access you can follow this guide here:

    https://premium.wpmudev.org/manuals/wpmu-dev-dashboard-enabling-staff-login/

    Have a nice day. Cheers!

    Rupok

  • Rupok
    • Support Ninja

    Hi Paul

    Can you please try changing "Language URL format" to "Language name added as a parameter" and check if the problem is gone? If yes, then it will be easier for us to determine exactly what is causing the issue. Please check the attached screenshot for reference.

    Have a nice day. Cheers!

    Rupok

  • BizE
    • Site Builder, Child of Zeus

    Hi Rupok

    Have done as suggested, tested and pleased to confirm that it now works ok for all languages!

    I am not sure why we had set up that particular setting in WPML, but is it your understanding that the setting you have now recommended will not cause us any other issues?

    On a separate note, our site will be running games and we are now writing an API to check / fetch a users membership status in order to a) validate their membership status and b) present their game score in a database / leaderboard. Can advise in which wp table, we can find the users’ membership data?

    Many thanks for the fix and look forward to hearing back on this final point.

    Regards,

    Paul

  • Rupok
    • Support Ninja

    Hi Paul

    Membership data is disbursed in different tables. You will get information in “wp_options”, “wp_postmeta”, “wp_posts” and “wp_usermeta” tables.

    Please search with “ms_” keyword in your database and you will get all the existence of information listed for you. Please see the attached screenshot for reference.

    Moveover, we have a very powerful API documentation for Membership 2 Pro. You will get the documentation here: “Dashboard > Membership 2 > Help > API Docs Tab”.

    Have a nice day. Cheers!

    Rupok

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.