Iis 想知道我是否可以合并一些重写规则

Iis 想知道我是否可以合并一些重写规则,iis,url-rewriting,web-config,Iis,Url Rewriting,Web Config,我把这个web配置文件放了很久,现在想知道是否可以合并或重新排序一些规则来获得一个小的速度提升。谢谢你的关注。也许是规范规则和http到https <rule name="Redirect Folder"> <match url="^news/archive/*"/> <action type="Redirect" url="articles/" appendQueryStr

我把这个web配置文件放了很久,现在想知道是否可以合并或重新排序一些规则来获得一个小的速度提升。谢谢你的关注。也许是规范规则和http到https

        <rule name="Redirect Folder">
                   <match url="^news/archive/*"/>
                   <action type="Redirect" url="articles/" appendQueryString="false" redirectType="Permanent" />
            </rule>
            <rule name="Redirectoldaspfiles" stopProcessing="true">
                <match url="^(.*)\.asp" />                  
                <action type="Redirect" url="https://www.example.com" appendQueryString="false" redirectType="Permanent" />
            </rule>             
            <rule name="Default Document" stopProcessing="true"> 
                <match url="(.*?)/?home\.html$" ignoreCase="true" /> 
                <action type="Redirect" url="{R:1}" redirectType="Permanent" /> 
             </rule>            
            <rule name="CanonicalHostNameRule1">
                <match url="(.*)" />
                <conditions>
                    <add input="{HTTP_HOST}" pattern="^www\.example\.com$" negate="true" />
                </conditions>
                <action type="Redirect" url="https://www.example.com/{R:1}" redirectType="Permanent" />
            </rule>
            <rule name="Redirect to https" stopProcessing="true">
                <match url=".*" />
                <conditions>
                    <add input="{HTTPS}" pattern="off" ignoreCase="true" />
                </conditions>
                <action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Permanent" appendQueryString="false" />
            </rule> 
            <rule name="RedirectUserFriendlyURL1" stopProcessing="true">
                <match url="^(.*)\.html" />                 
                <conditions>
                    <add input="{REQUEST_METHOD}" pattern="^POST$" negate="true" />
                </conditions>
                <action type="Redirect" url="{R:1}" appendQueryString="false" redirectType="Permanent" />
            </rule>
            <rule name="RewriteUserFriendlyURL1" stopProcessing="true">
                <match url=".*" />
                <conditions>
                    <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                    <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                </conditions>
                <action type="Rewrite" url="{PATH_INFO}.html" />
                <serverVariables>
                    <set name="HTTP_X_ORIGINAL_ACCEPT_ENCODING" value="{HTTP_ACCEPT_ENCODING}" />
                    <set name="HTTP_ACCEPT_ENCODING" value="" />
                </serverVariables>
            </rule>


您能告诉我CanonicalHostNameRule1和重定向到https之间的关系吗?这些www.example.com是您的web应用程序的主机url吗?如果这是您的url,则将这两个规则合并为一个。当然,实际的域是example.com。经典的是。在寻找提高页面加载速度的方法时,前几天我查看了我的web配置文件,并认为如果我在CanonicalHostNameRule1中将http更改为https,我可能能够摆脱重定向到https的情况。但我不确定是什么促使我提出这个问题。提前谢谢你!注意:它应该读为h t p s://www.example。com,但h t p s没有显示