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

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -