1
私はSSL証明書を持つ1つのWebサイトを持っています。 ドメインはhttp://example.com です。サブドメインhttp://api.example.comにはSSL証明書がありません。Asp.net mvc 301リダイレクト
私はhttp://example.comをhttps://example.comにweb.config MVCを使用してリダイレクトしたいと思います。
私はこれをやっている、サブドメインも私は私のメインのドメインをリダイレクトする301
リダイレクトされます。
私のコードは以下の通りです:
<rewrite>
<rules>
<rule name="Redirect-HTTP-HTTPS-IIS">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="^OFF$" ignoreCase="true" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Permanent" />
</rule>
</rules>
</rewrite>
試してみてくださいignoreCase = "true" /> –