4

I'm trying to handle 403 and 404 errors in my web app. I have read MS instructions and applied on my server. IIS7 manager effectively handles this by editing my web.config as:

<httpRedirect enabled="false" destination="/MySite" httpResponseStatus="Temporary" />
   <httpErrors>
      <remove statusCode="404" subStatusCode="-1" />
      <remove statusCode="403" subStatusCode="-1" />
      <error statusCode="403" prefixLanguageFilePath="" path="/mySite/Error.aspx" responseMode="ExecuteURL" />
       <error statusCode="404" prefixLanguageFilePath="" path="/mySite/Error.aspx" responseMode="ExecuteURL" />
   </httpErrors>

It does handle requests like http://www.mysite/fictiousURL.aspx but won't work on http://www.mysite/fictiousURLTest.html. It seems to only be able to handle aspx requests.

I've also tried http://www.15seconds.com/issue/030102.htm by adding this configuration <customErrors mode="On" defaultRedirect="/mysite/error.aspx" /> in the system.web node.

Anyone know a) Why is IIS7 only handling the aspx and b) Anyone know how to handle universal requsts like http://www.mysite/fictiousURLTest.html?

Thanks, Bill N

Bill Nielsen
  • 866
  • 2
  • 7
  • 18

1 Answers1

2

See my response given here: IIS7 and HTTP status code handling

It looks like you may need to set

  <system.webServer>
    <httpErrors existingResponse="PassThrough" />
  </system.webServer>
Community
  • 1
  • 1
Rob
  • 1,060
  • 6
  • 12