本文介绍了如果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);

           }

推荐答案


这篇关于如果request.url在Global.asax下是本地的http,如何纠正url中的response.redirect到https?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-02 18:50