Custom error404 doesn't work for html sites



I added in IIS custom error pages. In web.config it looks like this:
      <remove statusCode="500" subStatusCode="-1" />
      <remove statusCode="404" subStatusCode="-1" />
      <error statusCode="404" path="/Error_404" responseMode="ExecuteURL" />
      <error statusCode="500" path="/Error500/en_US/error-500.html" responseMode="ExecuteURL" />
<customErrors defaultRedirect="~/Error_404" mode="On">
            <error redirect="~/Error_404" statusCode="404" />
This work perfectly if I shut down module Iifinity.FriendlyUrl. If it's working when I type some random html or pdf site I just get blank page in Google Chrome or Opera. In IE I get error 404 but not my custom page.
For example:
If I type:

www.mydomain.com/asdsadsa.aspx - it works
www.mydomain.com/sadsadas - it works
www.mydomain.com/adasas.html - dosen't work with friendly url
www.mydomain.com/asdsadas.pdf - doesn't work with friendly url