With the following configuration in my web.config file,
<customErrors mode="On" redirectMode="ResponseRedirect" >
<error statusCode="404" redirect="/404" />
</customErrors>
<httpErrors errorMode="Custom">
<remove statusCode="404" subStatusCode="-1" />
<error statusCode="404" prefixLanguageFilePath="" path="/404" responseMode="ExecuteURL" />
</httpErrors>
The 404 page works nice, but for urls that end with .aspx an redirect happens and the query string for the url is removed. If I change parameter "redirectMode" in the tag "customErrors" to "ResponseRewrite" it stops working for .aspx urls and I just get the default ASP.NET error page. How can I fix this? I need the query string on the 404 page to be able to redirect the user to the correct new url.
/Viktor