Configuring IIS7 404 page when using IIS7 urlrewrite module

Posted by Peter on Pro Webmasters See other posts from Pro Webmasters or by Peter
Published on 2011-03-12T12:45:28Z Indexed on 2011/03/13 0:19 UTC
Read the original article Hit count: 1814

Filed under:
|

I've got custom errors to work for .aspx page like: www.domain.com/whateverdfdgdfg.aspx

But, when no .aspx url is requested, (like http://www.domain.com/hfdkfdh4545) it results in an error:

HTTP Error 404.0 - Not Found The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

I have this in my web.config:

<customErrors mode="On" defaultRedirect="/error/1" redirectMode="ResponseRedirect">
  <error statusCode="404" redirect="/404.aspx" />
</customErrors>

404.aspx exists, since the above DOES work when requesting non-existent .aspx pages...

I also configured the errorpages in IIS7: Status code: 404 Path: /404.aspx Type: Execute URL Entry type: Local

My websites application pool setting is "ASP.NET v4.0"

Now why is this still not working?

© Pro Webmasters or respective owner

Related posts about .NET

Related posts about iis7