example1.example.com というメイン アドレスがあり、このアドレスに対して発行された Https 証明書があります。しかし、メインのコードは example2.example.com にあり、最初のコードをこれにリダイレクトしていました。https を使用したいのですが、それが可能かどうか知りたいです。2 番目のサーバーには https 証明書がありません。
2 に答える
0
Global.asaxには、次のブロックがあります。
if (Request.ServerVariables["HTTPS"] != "on")
{
Response.Redirect(Request.Url.AbsoluteUri.Replace("http://", "https://"), true);
return;
}
これにより、httpリクエストがhttpsに変わります。これは、example2がexample1を参照している場合、example1で実行する必要があります。
あなたがやりたいことのために、これはうまくいくはずです:
if (Request.ServerVariables["HTTPS"] == "on")
{
Response.Redirect(Request.Url.AbsoluteUri.Replace("https://", "http://"), true);
return;
}
于 2012-09-13T13:36:44.267 に答える