在项目的web.config下面加上下面的配置:

    <rewrite>
      <rules>
        <clear />
        <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>
      </rules>
    </rewrite>

此节点,在<system.webServer>标签下面。

其他不用配置

相关文章:

  • 2021-05-06
  • 2021-11-21
  • 2022-12-23
  • 2021-11-21
  • 2021-10-29
猜你喜欢
  • 2022-12-23
  • 2021-05-27
  • 2022-01-16
  • 2023-01-28
  • 2021-11-21
  • 2021-05-05
相关资源
相似解决方案