Friday, 18 October 2013

Redirect to custom error page when server or application get error 404 or 403 or 405

for Custorm

<system.web>
<customErrors mode="On" defaultRedirect="~/Error-page not found">
     <error statusCode="404"  redirect="~/Error-page not found" />
      <error statusCode="403" redirect="~/Error-page not found" />
      <error statusCode="500" redirect="~/Error-page not found" />
    </customErrors>
</system.web>




for Http-

<system.webServer>
 <httpErrors errorMode="Custom" defaultResponseMode="ExecuteURL">
      <remove statusCode="404" subStatusCode="-1" />
      <error statusCode="404" prefixLanguageFilePath="" path="/RFBij/Error-page not found" responseMode="ExecuteURL" />
      <remove statusCode="403" subStatusCode="-1" />
      <error statusCode="403" prefixLanguageFilePath="" path="/RFBij/Error-page not found" responseMode="ExecuteURL" />
      <remove statusCode="405" subStatusCode="-1" />
      <error statusCode="405" prefixLanguageFilePath="" path="/RFBij/Error-page not found" responseMode="ExecuteURL" />
    </httpErrors>
</system.webServer>

No comments:

Post a Comment

How to highlight selected text in notepad++

  –> To highlight a block of code in Notepad++, please do the following steps step-1  :- Select the required text. step-2  :- Right click...