URL Rewrite http to https EXCEPT files in a specific subfolder

Posted by BrettRobi on Pro Webmasters See other posts from Pro Webmasters or by BrettRobi
Published on 2011-03-07T21:57:32Z Indexed on 2012/06/25 15:23 UTC
Read the original article Hit count: 280

Filed under:
|

I am trying to force all traffic on my web site to use HTTPS, using the URL Rewrite 2.0 module added to IIS 7.5. I got that working and now have a need to exclude a couple of pages from using SSL. So I need a rule to rewrite all URL except those referencing this folder to HTTPS. I've been banging my head against the wall on this and am hoping someone can help. I tried creating a rule to match all URL except those in a nossl subfolder as in this example:

<rule name="HTTP to HTTPS redirect" enabled="true" stopProcessing="true">
  <match url="(/nossl/.*)" negate="true" />
  <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
        <add input="{HTTPS}" pattern="off" />
  </conditions>
  <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Found" />
</rule>

But this doesn't work. Can anyone help?

© Pro Webmasters or respective owner

Related posts about iis

Related posts about url-rewriting