查看: 2  |  回复: 0
  ASP http跳转到https的代码
楼主
发表于 昨天 17:22

判断代码:

<%
if 1=1 then
    Server_HTTPS=lcase(request.ServerVariables("HTTPS"))
    if Server_HTTPS="off" then
        strMySeverURL= request.ServerVariables("URL")
        if lcase(strMySeverURL)= "/index.asp" then strMySeverURL=""

        Response.Redirect "https://" & request.ServerVariables("SERVER_NAME") & strMySeverURL
        Response.end
    end if
end if
%>

其中if 1=1 then如果变成if 1=2 then就不执行,是个开关。

您需要登录后才可以回帖 登录 | 立即注册
【本版规则】请勿发表违反国家法律的内容,否则会被冻结账号和删贴。
用户名: 立即注册
密码:
2020-2026 MaNongKu.com