404 Page instead of Unauthorized Page

Hi everyone,

I’m currently working on a MODX 3.1.2-pl website and have an issue with access control. I have a page “Styles (id: 53)” that should only be accessible to logged-in users in the “Freemember” or “Paidmember” groups.

If an anonymous visitor tries to access this page Styles (53), I want them to be redirected to the unauthorized page (as set in the context settings).

However, instead of being redirected to the unauthorized page, they are being taken to the 404 (page not found) page.

Here’s what I’ve done so far:

  • Assigned the correct resource groups “Freemember” and “Paidmember” to the protected page “Styles (53)”.
  • Made sure the (anonymous) user group has access to the context and to the resource group.
  • Set the unauthorized_page setting in the context to a valid resource ID.
  • Flushed permissions and cleared the site cache multiple times.
  • Temporarily disabled the gateway plugin
  • Temporarily disabled friendly URLS in system settings

Despite all this, the page still results in a 404 error when accessed by a non-logged-in user, instead of redirecting to the unauthorized page.

My site uses Login and Babel extras

Is there something I’m missing?
Any suggestions or insight would be greatly appreciated!

Thanks in advance!

From the screenshots it looks like the (anonymous) user group has only access to the “AnonymousOnly” resource group.

As the resource “Styles (53)” is in the resource groups “FreeMember” and “PaidMember”, I think the (anonymous) user group needs Load Only access to these resource groups as well to see the “Unauthorized Page”.

1 Like

Thank You halftrainedharry, yes you are right, it works now!

This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.