ASP.NET 403 redirect not captured?

My ASP.NET 4.0 application seems to ignore my custom 403 redirect.  I have prevented reading of a log folder on the site.  If a user navigates to it on a browser they recieve a 403.14 'read not permitted' error.  All my error conditions default to the 404 page, why?  

Here's my web.config custom error markup:

<customErrors mode="On" defaultRedirect="OopsAnError.aspx"  >      
     <error statusCode="403" redirect="Restricted.aspx" />
     <error statusCode="404" redirect="PageNotFound.aspx" />
</customErrors>
Phil5780Asked:
Who is Participating?
 
Alpesh PatelConnect With a Mentor Assistant ConsultantCommented:
It is only available with Membership provider. With custom authentication you cannot do this.
0
 
Alfred A.Commented:
Check the second-to-the-last comment in this link:

http://forums.asp.net/t/1462153.aspx

You can also set the error page on each web page if you want.  Check this out:

http://www.beansoftware.com/ASP.NET-Tutorials/Custom-Error-Pages.aspx

I hope this helps.
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
thefritterfatboyCommented:
May be a very simplistic question but do the files; OopsAnError.aspx and Restricted.aspx both exist?
0
 
Phil5780Author Commented:
Can membership provider be used with requiring a user to login?
0
 
Phil5780Author Commented:
Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.