Mobile app version of vmapp.org
Login or Join
BetL925

: 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

@BetL925

Posted in: #Iis #UrlRewriting

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?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @BetL925

1 Comments

Sorted by latest first Latest Oldest Best

 

@Tiffany637

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>

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme