asp.net - Custom error redirect on 404 code for non-aspx files -


i added web.config:

<customerrors mode="remoteonly" defaultredirect="~/pages/error/error.aspx">     <error statuscode="404" redirect="~/pages/error/error404.aspx"/> </customerrors> 

and works fine .aspx pages. when try type: http://domainname.com/notexist, default 404.

i tried suggestions from: 404 redirecting non aspx pages

but nothing works me. ideas why?

i use .net 3.5, application pool pipeline mode integrated.

after adding <httperrors> get: enter image description here

try this, provide separate status. can execute per requirement.

<system.web>     <customerrors mode="remoteonly" defaultredirect="~/pages/error/error.aspx">         <error statuscode="404" redirect="~/pages/error/error404.aspx"/>     </customerrors> </system.web> <system.webserver> <asp scripterrorsenttobrowser="true"/>         <httperrors errormode="detailed">           <error statuscode="401" path="/pages/error/error.aspx" responsemode="redirect" />           <error statuscode="403" path="/pages/error/error.aspx" responsemode="executeurl" />           <error statuscode="404" path="/pages/error/error404.aspx" responsemode="executeurl" />           <error statuscode="500" path="/pages/error/error.aspx" responsemode="executeurl" />     </httperrors> </system.webserver> 

Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -