asp.net - .net w2012 r2 custom error 404 not working -
this web.config code works under w2003 .net 4:
<customerrors mode="on" defaultredirect="error.aspx"> <error statuscode="404" redirect="error-notfound.aspx"/> </customerrors>
on w2012 r2 .net 4 code doesn't work: got no erros when calling page not found, iis shows 404.htm located in c:\inetpub\custerr\en-us, not error-notfound.aspx expected.
try creating same error rules in system.webserver section of web.config file, example...
<system.webserver> <httperrors errormode="custom" defaultresponsemode="executeurl"> <remove statuscode="404" /> <error statuscode="404" path="/error-notfound.aspx" responsemode="redirect" /> </httperrors> </system.webserver>
Comments
Post a Comment