We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 50124
    • 11 Posts
    Modx Version: 2.5.7
    Php Version: 5.6

    Hi,

    I'm trying to setup a members only area but when a "Anonymous" user tries to view the page instead of giving a 401 (and showing the unauthorized page) it gives a 500 error. in the error logs i see the following error "Premature end of script headers: index.php".

    My setup is as follows
    - I installed the plugin Login (https://docs.modx.com/extras/revo/login/login.login);
    - I created a login page and made sure it was published;
    - I set the unauthorized page inside the settings of the context to the login page (and tested if it was functioning using $modx->sendUnauthorizedPage());
    - I created a resource group named "Members Area" and added all pages except for the login page;
    - I created a access policy named "Members" and added the resource group to this policy giving it "Load, List, View" permission;
    - I added a user to this group.
    - I added the resource group to (Anonymous) giving it "Load Only" permissions (https://docs.modx.com/revolution/2.x/administering-your-site/security/security-tutorials/more-on-the-anonymous-user-group).

    This setup gives me the following results
    - When i access the login page directly as a Anonymous user everything works as intended;
    - When i access a members only page as Anonymous it loads for a while and then returns a http 500 error;
    - When i login to the members area i can acces members pages without any issue.

    Members Area Link: http://dev.jasperbriels.nl
    Login Page: http://dev.jasperbriels.nl/login

    Does anyone know how i could solve this?

    Installed Plugins / Extras:
    - Login;
    - Wayfinder;
    - X-routing; (i'v tried disabling this one)
    - Codemirror.

    This question has been answered by noloony. See the first response.

    • discuss.answer
      • 50124
      • 11 Posts
      Ok i deleted the cache files (again) and tried din't work however after i logged in and then logged out again it now seems to be working.
        • 3749
        • 24,544 Posts
        You always need to flush all sessions whenever you make a permission-system change. You'd think that just flushing permissions would do, but it's not enough.

          Did I help you? Buy me a beer
          Get my Book: MODX:The Official Guide
          MODX info for everyone: http://bobsguides.com/modx.html
          My MODX Extras
          Bob's Guides is now hosted at A2 MODX Hosting