title: Static images and CSS not showing (401) but bundled css and js do
body: <p>We just deployed an ASP.NET MVC 4 webapp in production and are experimenting a strange behavior : the app works but <strong>images are not showing and part of the CSS is not loading</strong>.</p>
  
  <p>When analyzing the HTTP requests, I can see that : </p>
  
  <ul>
  <li>requests to images (*.png) <strong>fail</strong> with a <strong>401</strong> status code</li>
  <li>requests to css files <strong>fail</strong> with a <strong>401</strong> status code</li>
  <li>requests to bundled resources (*.js / *.css) are <strong>successful</strong>.</li>
  </ul>
  
  <p>The application has worked properly in our Dev/Integration/Staging and Pre-Prod environment so I expect it to be some IIS configuration trick ....</p>
  
  <p>We have already checked that : </p>
  
  <ul>
  <li>only anonymous authentication is enabled in IIS</li>
  <li>the IIS Pool user has Read access to the resources</li>
  </ul>
  
  <p>I should add that some old HTTP modules are also configured (they take care of redirecting the user to some login page if he is not authenticated ...)</p>
  
  <p>(I don't know whether this is relevant, but the app fails with HTTP status 401 when accessing its root Url (virtual directory) without the trailing slash ... i.e. <code>https://{the domain}/{WebApp Name}</code> fails but <code>https://{the domain}/{WebApp Name}/</code> works fine)</p>
  
  <p>Any clue about what might be going on ?</p>
  
  <p>Thanks !</p>