Check application pool identity settings and make sure that your web application's appPool Identity is set ApplicationPoolIdentity and Managed Pipeline Mode as Integrated.
Then check your web config
system.webserver
modules and enable this configuration on your application web config.
<system.webserver><modules runallmanagedmodulesforallrequests="true"> </modules></system.webserver>
Fixing 404 errors on invalid URL’s with ASP.NET’s URL Rewrite
UPDATED
================================
Configuration
How to do a rewrite rule in web.config
URL Rewriting in ASP.NET