如果request.url在Global.asax下是本地的http,如何纠正url中的response.redirect到https? [英] How to rectify response.redirect to https in url if the request.url is http locally under Global.asax?
本文介绍了如果request.url在Global.asax下是本地的http,如何纠正url中的response.redirect到https?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果request.url是本地的http,如何纠正response.redirect到url中的https?
以下是我在Global.asax下的代码
How to rectify response.redirect to https in url if the request.url is http in local?
Following is my code under Global.asax
if (pageRequest.Scheme == "http" && pageRequest.Host.ToString()!="localhost" && requestPath.Contains(".aspx"))
{
Response.Redirect("https://" + pageRequest.Host + pageRequest.PathAndQuery, true);
}
推荐答案
重新发布...
如何使用global.asax将http转换为https和其他方式? [ ^ ]
如何在IIS 6中启用SSL证书并在Global.asax下将http转换为https? [ ^ ]
Repost...
How to convert http to https and other way around using global.asax ?[^]
How to enable SSL certificate in IIS 6 and convert http to https under Global.asax?[^]
这篇关于如果request.url在Global.asax下是本地的http,如何纠正url中的response.redirect到https?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文