I am using roles/sitemap to restrict user’s access to certain pages like so:
<location path="Reporting.aspx">
<system.web>
<authorization>
<allow roles="Admin, Manager" />
<deny users="*" />
</authorization>
</system.web>
</location>
I am just wondering how can I redirect people without access to one of my own aspx pages, instead of the default access denied page?
You don’t even need to program a solution to this. You can change the pages people are redirected to due to 404 errors, denied errors (405?) etc from your website configuration. You just edit the htaccess file to point to your own page.
Seems like the kind of thing they’d program into IIS to, may be worth checking into that.