Q:

IIS server web.config HTTPS on every page except homepage?

I have an ExpressionEngine installation running on an IIS server. Currently I am using a rewrite rule which forces the website to use the HTTPS protocol on every page. I would like to change this so that it uses HTTPS on every page except for the homepage. Unfortunately, I just don't know enough about web.config rewrite rules to figure it out. Thanks in advance!
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <clear />
                <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="Permanent" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

A:

If you do not want to apply redirect rule to your homepage, you need to add condition and filter homepage url. It should be like that:
<rule name="Redirect to HTTPS" stopProcessing="true">
    <match url="(.*)" />
    <conditions>
        <add input="{HTTPS}" pattern="^OFF$" />
        <add input="{REQUEST_URI}" pattern="^/$" negate="true" />
    </conditions>
    <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Permanent" />
</rule>

