I have an SSL certificate and have set up a rewrite rule in my web.config to direct all traffic to https. This is working fine (code below if anyone finds it useful), however I now have a service I’m exposing to my phone clients and I DON’T want that to use HTTPS.
Can I create an exception? So any request for http://www.mydomain.com/PhoneService/Seek.svc is not re-directed to https://www.mydomain.com…..
<rewrite>
<rules>
<rule name="HTTP to HTTPS redirect" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="off" ignoreCase="true" />
</conditions>
<action type="Redirect" redirectType="Found" url="https://{HTTP_HOST}/{R:1}" />
</rule>
</rules>
</rewrite>
You can use another condition to your rule to ensure that the path does not end in
seek.svc:The line:
checks the
URLvariable and ends withseek.svc. We negate the condition because we only want the rule to apply if it doesn’t match.