We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22446
    • 181 Posts
    I have my error page set to ID 20. I have my unauthorized page set to ID 208, which is my login page.

    On my protected pages, which are ID’s 163, 207 & 209 I have placed the [[!isLoggedin]] snippet.

    If a user tries to visit one of the protected pages without being logged in they are directed to the error page instead of the unauthorized page. Is there something I am missing? Does the [[!Profile]] snippet or [[!login]] snippet need to be included on the pages with the [[!isLoggedin]]?
      • 3749
      • 24,544 Posts
      In Revolution, pages that you aren’t authorized to see are "not found" when MODx looks for them so they sort of don’t exist and you end up at the 404 page when you try to access them.

      I think the solution is to give the users "load only" permission for them. That way they will exist but the use won’t be able to "view" them.
        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
        • 22446
        • 181 Posts
        BobRay,

        I would like anyone who may be accessing the protected pages, whether they are a user or not, to be directed to the login if they are not logged in already.

        I tried to set my anonymous users to give them load only permission, but I am still getting the error 404 page instead of redirecting them to the login page.
          • 3749
          • 24,544 Posts
          That should work. Be sure you’ve flushed permissions, cleared the site and browser cache, and flushed sessions.
            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