When I call a page with a non authorized character (such as *), i get a yellow page "A potentially dangerous Request.Path value was detected". It looks like it is a 400 error page. My goal is to customize this page and show a clean error page or redirect to home page (i tried both solutions). Here is what i wrote in my web.config:
<system.webServer>
<httpErrors errorMode="Custom">
<remove statusCode="400" subStatusCode="-1" />
<remove statusCode="404" subStatusCode="-1" />
<error statusCode="400" path="/page-non-trouvee.aspx?status=400" responseMode="ExecuteURL" />
<error statusCode="404" path="/" responseMode="ExecuteURL" />
</httpErrors>
I'm using IIS7. The point is my 400 page is still shown as a yellow error page.
There must be a workaround because although the Stack Exchange Data Explorer has this problem with https://data.stackexchange.com/users  Stack Overflow itself does not: https://stackoverflow.com/users 
Any ideas?