: URL Rewrite http to https EXCEPT files in a specific subfolder 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
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?
More posts by @BetL925
1 Comments
Sorted by latest first Latest Oldest Best
If anyone is curious I resolved this problem with the following syntax:
<rule name="NoSSL - folder" enabled="true" stopProcessing="true">
<match url="^nossl/.*" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
</conditions>
<action type="None" />
</rule>
<rule name="Redirect to HTTPS" enabled="true" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{HTTPS}" pattern="off" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Found" />
</rule>
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.