Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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'm migrating an ASP.NET app from IIS6 to IIS7 and in doing this I'm also porting my rewrite settings from Intelligencia.UrlRewriter to using IIS rewriting.

In have some problems with "Rejected-By-Urlscan" errors (urls like /åäö.html should be redirected to my 404 page).

In Intelligencia.UrlRewriter this worked:

<rewrite url="^~/Rejected-By-UrlScan" to="~/sidan-finns-inte.html"/>

I ported this to:

  <rule name="Rejected-By-UrlScan">
    <match url="^Rejected-By-UrlScan" />
    <action type="Rewrite" url="/sidan-finns-inte.html" />

But I keep gettings IIS internal 404 error instead of my 404 error (sidan-finns-inte.html).

How can I fix this?

share|improve this question

I solved it by adding:

   <httpErrors errorMode="Custom">
      <remove statusCode="404" subStatusCode="-1" />
      <error statusCode="404" path="/404.aspx" responseMode="ExecuteURL" />
      <remove statusCode="500" subStatusCode="-1" />
      <error statusCode="500" path="/Error.aspx" responseMode="ExecuteURL" />

In Web.Config

share|improve this answer

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.