What is the meaning of ^ ON $ and ^ OFF $ in url rewrite pattern and according to this pattern
I came across this rule:
<rule name="Redirect to HTTPS" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="^OFF$" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="SeeOther" />
</rule>
what is on or off in a pattern and what matches that pattern?
+3
source to share
1 answer
Template Failure: Make sure the rule is only executed when the request comes over http, otherwise you may end up in an infinite loop.
So, add a clause indicating that {HTTPS} is disabled.
the ^ = (start of line or "negative" if at the beginning of a range)
$ = (end of line)
although the extra start / stop characters seem to be redundant for this purpose
+8
source to share