现在https越来越流行,更多的网站开始全站使用ssl加密传输,但kesioncms似乎在这一点上没有做过多的考虑;本人在架设网站时就发现完全没法使用cms,比如我的网站,因为系统获取的url是http://www.s88.com:443,无论你怎么更改成https://www.s88.com都没有用,而我网站的初衷又不想开启网站http://访问,所有的访问都需要经过https,那么,这就需要改代码了。 以下基于KesionCMS X2/X1更改: 找到文件:KS_Cls/Kesion.CommonCls.asp,约724行 Public Function GetAutoDomain() Dim TempPath If Request.ServerVariables("SERVER_PORT") = "80" Then GetAutoDomain = Request.ServerVariables("SERVER_NAME") Else GetAutoDomain = Request.ServerVariables("SERVER_NAME") & ":" & Request.ServerVariables("SERVER_PORT") End If If Instr(UCASE(GetAutoDomain),"/W3SVC")<>0 Then GetAutoDomain=Left(GetAutoDomain,Instr(GetAutoDomain,"/W3SVC")) End If GetAutoDomain = "http://" & GetAutoDomain End Function 改成: Public Function GetAutoDomain() Dim TempPath GetAutoDomain = Request.ServerVariables("SERVER_NAME") If Instr(UCASE(GetAutoDomain),"/W3SVC")<>0 Then GetAutoDomain=Left(GetAutoDomain,Instr(GetAutoDomain,"/W3SVC")) End If If Request.ServerVariables("SERVER_PORT") = "80" Then GetAutoDomain = "http://" & GetAutoDomain elseif Request.ServerVariables("SERVER_PORT") = "443" Then GetAutoDomain = "https://" & GetAutoDomain else GetAutoDomain = "http://" & GetAutoDomain & ":" & Request.ServerVariables("SERVER_PORT") end if End Function |