IIS URL Redirect HTTP to HTTPS excluding one or more folders
If you've stumbled upon this post, it most likely means that you're trying to redirect all the HTTP requests coming to your website to the HTTPS channel using the IIS URL Rewrite module (in case you don't know what it is or if you need help installing it, check out this other post). To make things short, here's the rewrite rule you're probably looking for: Now, what if we want to keep one or more folders (and all their contents) accessible through HTTP? Here's a nice way to create an exception to the above rule adding a single additional line: As we can see, we took advantage of the negate="true" attribute to create an excluding input pattern, which - if matched - will prevent that rule from triggering: therefore, all the pages included in that folder will be accessible without SSL. Needless to say, you can add multiple input patterns to exclude additional folders from the HTTP-to-HTTPS mandatory redirect as well. Pretty neat, right? For additional info, check out the following IIS URL Rewrite Module resources by Microsoft: Using URL Rewrite Module 2.0 (including docs, guide, tutorials & samples) URL Rewrite Module - Video Walkthrough URL Rewrite Module - Community Forum URL Rewrite Module - Download Page That's it for now: I hope that this could help other IIS administrators that are struggling against this issue! Read the full article













