Quantcast
Channel: URL Rewrite Module
Viewing all articles
Browse latest Browse all 2482

redirect anything non-secure to HTTP?

$
0
0

Hi All: I have a rule to redirect any secure page to HTTPS:

<rule name="force https" stopProcessing="true" enabled="true"><match url="(account|checkout|login)" ignoreCase="true" /><conditions><add input="{HTTPS}" pattern="off" ignoreCase="true" /><add input="{HTTP_HOST}" pattern="localhost" negate="true" /></conditions><action type="Redirect" redirectType="Found" url="https://{HTTP_HOST}{REQUEST_URI}" appendQueryString="true" /></rule>

I want to have an opposite rule that takes any URL not matching those pages to HTTP. I tried reversing my logic using "negate":

<rule name="force http" stopProcessing="true" enabled="true" ><match url="(account|checkout|login)" ignoreCase="true" negate="true" /><conditions><add input="{HTTP}" pattern="off" ignoreCase="true" /></conditions><action type="Redirect" redirectType="Found" url="http://{HTTP_HOST}{REQUEST_URI}" appendQueryString="true" /></rule>

But that doesn't seem to work. Do I need to use a logical operator like "!" instead? like:

<match url="!(account|checkout|login)" ignoreCase="true" />

or is there a cleaner way to do this?


Viewing all articles
Browse latest Browse all 2482

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>