Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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" />

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?

share|improve this question

migrated from stackoverflow.com Mar 12 '11 at 23:31

This question came from our site for professional and enthusiast programmers.

Probably belongs on webmasters.stackexchange.com. – Jon Mar 12 '11 at 12:59

Have you tried setting the following?

  <httpErrors existingResponse="PassThrough" />

Here are a couple of references on error pages:



share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.