IIS Inbound 'Global' rules not propogating to individula websites

GaryC 1 Reputation point
2023-06-28T11:11:32.69+00:00

I have applied Global Outbound Rules via URL Rewrite on my IIS WebServer and these have populated and are shown against each individual website.

However, if I try and do this for an Inbound rule, it is not propogating and is not showing in the URLRewrite module against any website.

The rule is shown below, and it appear as below in ApplicationHost.Config - note that the outbound rul is fine

        <rewrite>
	   <globalRules>
                <rule name="Redirect http to https" stopProcessing="true">
                    <match url="(.*)" />
                    <conditions>
                        <add input="{HTTPS}" pattern="^OFF$" />
                    </conditions>
                    <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="SeeOther" />
                </rule>
            </globalRules>
            <outboundRules>
                <rule name="Add the STS header in HTTPS responses">
                    <match serverVariable="RESPONSE_Strict_Transport_Security" pattern=".*" />
                    <conditions>
                        <add input="{HTTPS}" pattern="on" />
                    </conditions>
                    <action type="Rewrite" value="max-age=31536000" />
                </rule>
            </outboundRules>
        </rewrite>

Thanks in anticipation

Windows development | Internet Information Services
Windows for business | Windows Server | User experience | Other
{count} votes

2 answers

Sort by: Most helpful
  1. Sam Wu-MSFT 7,561 Reputation points Microsoft External Staff
    2023-06-29T03:21:39.61+00:00

    @GaryC

    If you create the Inbound rule on the root site, its rules will appear in ApplicationHost.Config. If you create it on a site, its rules will appear in web.config. why does the rule about the root site not appear on a site like the outbound rul, It is because the inbound rule is conditional and does not apply to all sites.

    There are no conditions in the outbound rule. If you create a rule in the root site, its rule will appear in ApplicationHost.Config, but it is also applicable to sub-sites, so it will also appear in sub-sites. If you are in a sub-site create an outbound rule, its rule will appear in web.config, and it will only be used for the current site, and will not appear in the root site.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  2. Sam Wu-MSFT 7,561 Reputation points Microsoft External Staff
    2023-06-29T09:38:23.7733333+00:00

    @GaryC

    I re-edited my answer, hope this explanation can make you understand.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.