我们需要为单个 url 强制 "http" 。我们已经将所有 url 重定向到 https

We need to force "http" for a single url . We already have a redirect of all urls to https

我们的站点 https://www.globalcompanyformation.co.uk/ 在 web.config 文件中为所有 url 重定向到 "https://"。

现在我们有一个表单可以将信息发送到我们的子域,该子域托管在另一个 ip 地址中并且不安全。此表格在我们的页面 https://www.globalcompanyformation.co.uk/Gcf-index.html 中。 Firefox 会发出一条警告消息,指出您重定向到的站点不安全。我们不想看到这个警报,当我检查整个互联网时,唯一的解决方案是我让页面 "Gcf-index.html" 有 "http" 而不是 "https" 。

有什么方法可以强制 Gcf-index.html 在 "http" 中打开。 web.config 编码如下,用于重定向到所有 url 的 https。

<system.webServer>
    <rewrite>
    <rules>
      <clear />
      <rule name="Redirect to https" stopProcessing="true">
        <match url="(.*)" />
        <conditions>
            <add input="{HTTPS}" pattern="off" ignoreCase="true" />
             <add input="{REQUEST_FILENAME}" negate="true" pattern="^Gcf-index.*" />
        </conditions>
        <action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Permanent" appendQueryString="false" />
      </rule>
    </rules>
    </rewrite>
</system.webServer>

将第二个条件改为

<add input="{REQUEST_FILENAME}" negate="true" pattern="Gcf-index\.html" />

添加以下规则以在该表单页面上强制 http

<rule name="Force http on GCF" stopProcessing="true">
    <match url="Gcf-index\.html$" />
    <conditions>
        <add input="{HTTPS}" pattern="on" ignoreCase="true" />
    </conditions>
    <action type="Redirect" url="http://{HTTP_HOST}{REQUEST_URI}"
            redirectType="Permanent" appendQueryString="false" />
</rule>