Redirect to 404 page/node does not work in certain cases

Hi,

When I go to this imaginary url (http://mysite.com/language/some-section/some-other-section/?id=3) and try to fetch something by an ID that doesn’t exist, i get

“The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.”

I “throw” the 404 by using “return HttpNotFound()” in our controller.

If i check in Firebug, I can see that the page does return a 404 not found status code.

If i go to this imaginary url:
http://mysite.com/language/blablabpagethatdoesntexist

i do get the proper custom 404 page that we set up in the umbracoSettings.Config file.

 <errors>
      <error404>18342</error404>    
    </errors>

web routing section looks like this:

 <web.routing
    trySkipIisCustomErrors="true"
    internalRedirectPreservesTemplate="false">
  </web.routing>

I also tried adding this to the web.config (because it was not there yet):

 <error statusCode="404" redirect="/404"/> 

but that doesnt seem to do the trick, i still get the “resource moved” thing.

Does anyone have any idea how I can get umbraco to show my custom 404 page on links with bad querystrings ? As i said earlier, I can handle these bad qs values and return the 404 code but i don’t get the actual 404 page.


This is a companion discussion topic for the original entry at https://our.umbraco.com/forum/70928-redirect-to-404-pagenode-does-not-work-in-certain-cases