I have a issue with the web.config and forcing SSLs. I have a rule for rewriting url, because Nette PHP site is hosted.
<rule name="Rewrite Admin" stopProcessing="true">
<match url="^admin/(.*)" ignoreCase="true"/>
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="/admin/index.php" />
</rule>
In case I use https in url, the request is always redirected to http. (https://example.com/admin -> example.com/admin). When I use rule for SSL force below for all requests then error occur (Too many redirects). (have a 2 rules in web.config)
<rule name="Redirect to https">
<match url="(.*)"/>
<conditions>
<add input="{HTTPS}" pattern="Off"/>
<add input="{REQUEST_METHOD}" pattern="^get$|^head$" />
<add input="{REQUEST_URI}" pattern="^/(node)" negate="true" />
<add input="{REQUEST_URI}" pattern="^/(cbre)" negate="true" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}"/>
</rule>
How to force ssl for action type "rewrite"?
Thanks for help
