TheGateKeeper
TheGateKeeper

Reputation: 4540

Redirection not working

I have an asp.net application running on integrated pipeline and I have this specified in the web.config:

<customErrors mode="On">

  <error statusCode="404" redirect="404Error.aspx" />

</customErrors>

However, my site still shows the generic 404 asp.net error.

Why is this?

Upvotes: 0

Views: 139

Answers (3)

Damith
Damith

Reputation: 63105

redirect non aspx pages to error page

you can set custom error page for IIS by setting 404 error page for your virtual directory

Upvotes: 0

Damith
Damith

Reputation: 63105

this will work for you

<customErrors mode="On">
  <error statusCode="404" redirect="http://www.easycomputerformat.com/404error.aspx" />
</customErrors>

try following too...

<error statusCode="404" redirect="~/404Error.aspx"/>

sample :

<configuration>
  <system.web>
    <customErrors defaultRedirect="http://www.easycomputerformat.com/GenericError.htm"
                  mode="On">
      <error statusCode="404" redirect="http://www.easycomputerformat.com/404error.aspx"/>
      <error statusCode="403" redirect="http://www.easycomputerformat.com/403error.aspx"/>
    </customErrors>
  </system.web>
</configuration>

Upvotes: 1

Shyju
Shyju

Reputation: 218942

Are you sure the 404Error.aspx file exist in the root of the application ?

Upvotes: 0

Related Questions