使用HTTPS保护页面 [英] Secure Page using HTTPS

查看:83
本文介绍了使用HTTPS保护页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发了一个普通网站。我的客户在他的网络托管服务器(控制面板)上安装了SSL证书。



现在他想要登录页面作为安全页面(https应该出现在地址栏上)。 br />


我的问题如何使用ssl证书以及如何将普通的sign.aspx页面作为安全页面。我们必须写什么代码才能访问https://www.xyzwebsitename.com/sign.aspx\"使用控制面板的SSL证书



请提供给我任何提示或指导。



先谢谢。

I had developed one normal website. My client has installed SSL certificate on his web hosting server (control panel).

Now he wants login page as secure page (https should appear on address bar).

My question how can i use ssl certificate and how can i make normal sign.aspx page as secure page. what code we have to write so that on accessing "https://www.xyzwebsitename.com/sign.aspx"using SSL certificate from control panel

Please provide me any hint or guidline.

Thanks in Advance.

推荐答案

开始在其中 [ ^ ]。该主题还包含一个关于代码项目的优秀文章的链接:在HTTP之间切换和HTTPS自动:版本2 [ ^ ]
Start here[^]. This thread also contains a link back to an excellent article on Code Project: Switching Between HTTP and HTTPS Automatically: Version 2[^]


您好,

如果您只需要保护一个页面,则最简单的解决方案是Global.asax
Hi,
If you need to secure only one page most simplest solution is in Global.asax
protected void Application_BeginRequest(Object sender, EventArgs e)
 {
         if ( !Request.IsSecureConnection)
         {
     if(Request.Url.AbsoluteUri.contains("sign.aspx")
             {
                 string path = string.Format("https{0}", Request.Url.AbsoluteUri.Substring(4));
                 Response.Redirect(path);
             }
         }
 }



为了更好的解决方案,请检查这个 [ ^ ]或此处 [ ^ ]

希望这会有所帮助。


For better solution check this[^]orhere[^]
Hope this will help.


这篇关于使用HTTPS保护页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆