Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

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

1 Answer 1

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

In Web.Config

share|improve this answer

Your Answer

 
discard

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.