Error page is not working on iis server

163 views Asked by At

IIS server is not redirecting to the error page if the wrong url is not an .asp ending file.

Eg:

If the entered url is

http://domain.com/checking

The error page is not displayed, instead a default page of iis is displayed

If the url is http://domain.com/checking.aspx

and the checking.aspx is not available, then the user gets directed to error page.

Need help with the webconfig of asp.

<configuration>
  <system.web> 
    <compilation debug="true" targetFramework="4.5"/>
    <httpRuntime targetFramework="4.5"/>
    <customErrors mode="On" defaultRedirect="404.aspx">
      <error statusCode="404" redirect="404.aspx" />
      <error statusCode="500" redirect="404.aspx" />
    </customErrors>
  </system.web>
</configuration>
0

There are 0 answers