Reputation: 3777
We use the rewrite module, however for testing purposes I have removed all of the rewrite rules so there are zero of them in the web.config now.
When requesting an image file from one folder using https protocol, it permanently redirects it to http. However, when I request an image file from a different folder using https protocol it serves it just fine as https.
I was thinking it had to be a rewrite rule causing this, but as I've removed all the rewrite rules this doesn't seem to be the case. Any suggestions where else to look?
EDIT: I disabled all our rewrite rules and it started working properly, so I though "Great! It must be one of these rewrite rules!". But no... I found that if I have a single rewrite rule enabled the behavior returns regardless of the fact that the rewrite rule would never match the url I'm going to. Very strange.
EDIT2: I found that this issue only applies to the root web. When I go to resources in virtual apps there is no problem. Most of our website is in a virtual app, but a few resources are in the root web. I found that this problem applies not just to images, but to any resource in the root web including aspx pages.
Upvotes: 1
Views: 64
Reputation: 3777
So it turns out one place that rewrites can occur that I had not accounted for is in an httpModule, which so happened to be the the case for me. I was scanning past the httpModules section in my web.config a little too quickly and didn't see it at first, but it was a module called SecuritySwitch.
Upvotes: 1