I have a standard ASP.NET website with Forms Authentication.
The "Moderators" role which some users have, should allow them to access the "/moderators/" folder. However if a user who is not in the moderators role tries to access this folder, they are redirected to the standard login page, despite the fact they are already logged in.
This is configured in web.config:
<location path="moderators/" inheritInChildApplications="false">
<system.web>
<authorization>
<allow roles="Moderators" />
<deny users="*" />
</authorization>
</system.web>
</location>
How can I force them to a different page explaining they are not in the role rather than the login page?
I have more than one role with this problem, so I need to direct them to a different URL depending on the Role they are missing.