小编DrG*_*feN的帖子

在发布配置中插入重写规则

嗨,我想为“重定向到HTTPS”插入重写规则,但仅在我的发布配置上

这就是重写规则的样子

<system.webServer>
    <rewrite>
        <rules>
            <rule name="Redirect to HTTPS">
                <match url="(.*)" />
                <conditions>
                    <add input="{HTTPS}" pattern="off" ignoreCase="true" />
                    <add input="{URL}" pattern="/$" negate="true" />
                    <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                </conditions>
                <action type="Redirect" url="https://{SERVER_NAME}/{R:1}" redirectType="SeeOther" />
            </rule>
        </rules>
    </rewrite>
</system.webServer>
Run Code Online (Sandbox Code Playgroud)

如何仅在我的release.config中实现此目的?

asp.net xslt web-config-transform xdt-transform

1
推荐指数
2
解决办法
2625
查看次数