iis - Force SSL with exceptions in web.config -
i have following in web.config force ssl, need exclude specific paths being forced.
<?xml version="1.0" encoding="utf-8"?> <configuration> <system.webserver> <rewrite> <rules> <rule name="redirect https http" stopprocessing="true"> <match url="(.*)" /> <conditions> <add input="{https}" pattern="^off$" /> </conditions> <action type="redirect" url="https://{http_host}/{r:1}" redirecttype="seeother" /> </rule> </rules> </rewrite> </system.webserver> </configuration>
i've tried changing match url
have specific path inverted appears not caught.
examples:
site.com/app/default.aspx - force ssl site.com/app/service/cashback.svc - not forced, http site.com/app/service/different.svc - force ssl (so it's not full directory has excluded)
you can add exceptions <conditions>
, e.g.
<add input="{request_uri}" matchtype="pattern" negate="true" pattern="/app/service/cashback\.svc" />