Link to home
Start Free TrialLog in
Avatar of Phil5780
Phil5780

asked on

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>
Avatar of Alfred A.
Alfred A.
Flag of Australia image

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.
Avatar of thefritterfatboy
thefritterfatboy

May be a very simplistic question but do the files; OopsAnError.aspx and Restricted.aspx both exist?
ASKER CERTIFIED SOLUTION
Avatar of Alpesh Patel
Alpesh Patel
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Phil5780

ASKER

Can membership provider be used with requiring a user to login?
Thanks