Which elements on web.config to force re-direct to the another page?

A

ABC

I have a web site include three folders: public, admin and member.

I place web.config files to admin and members folders only allow admin and
members to access. If there are a user login as Demo which is not both
admin and member roles. But it should not to access admin and member
folders. I can success to limit accessing those folders, but it force users
re-login screen. It is not expected to redirect to public/default.aspx.

Which elements on web.config to force re-direct to the another page?
 
J

Josh Berkheimer

This should work.

Since 403 is access denied. Redirect to the page you want on 403
errors

<customErrors defaultRedirect="error.aspx" mode="On">
<error statusCode="403" redirect="re_login.aspx" />
</customErrors>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top