I have 4 servers in blue, 3 are load balanced, and 4 are for CMS purposes only.
An SSL certificate has been added for the main website, but not for the sobdomain that CMS runs on.
I wrote a rule that should find some kind of URL that does not contain "backoffice" and matches any other page in order to change it to https.
This works on regexr.com but for some reason does not work
<rewrite> <rules> <rule name="http to https" stopProcessing="true"> <match url="(https?:\/\/(?!backoffice).*)" /> <conditions> <add input="{HTTPS}" pattern="^OFF$" /> </conditions> <action type="Redirect" url="https://www.WEBSITENAME.com{R:1}" /> </rule> </rules> </rewrite>
Url Rewriting 2.1 is installed on all 4 servers, and I created a load balance set in azure for https.
switching to https manually works fine (along with load balancing).
Additional Information:
I tried many rules, including the existing answer. I can see what happens, for example, as https, but the page itself is not redirected.
There are two sets of load balancing, one for port 80 and the other for port 443. I donβt know if this is the reason, or there could be a potential reason that the redirect is not happening.
regex url-rewriting iis azure
Hazonko
source share