Redirect 使用web.config exclude robots.txt重定向

Redirect 使用web.config exclude robots.txt重定向,redirect,iis,web-config,Redirect,Iis,Web Config,我试着这样做: <configuration> <system.webServer> <rewrite> <rules> <rule name="Redirect to https" stopProcessing="true"> <match url="(.*)" />

我试着这样做:

<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="Redirect to https" stopProcessing="true">
                    <match url="(.*)" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{HTTPS}" pattern="off" ignoreCase="true" />
                        <add input="{REQUEST_URI}" negate="true" pattern="^/robots\.txt$" ignoreCase="true" />
                    </conditions>
                    <action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Permanent" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>


但它不起作用。。。我做错了什么?

您的规则是正确的,很可能是您的浏览器重定向了。请您清除浏览器的缓存,并尝试访问robots.txt

如果您能为您的问题提供正确的描述,那将是非常好的。