Copy codeThe Code is as follows: <! -- # Include file = "conn. asp" -->
<! -- # Include file = "KS_Cls/KS. PublicCls. asp" -->
<%
'================================================ ======
'Kesioncmsv4. 0 the second-level domain name of the personal space is transferred to the handler.
'================================================ ======
'*************************************** *************
'Software name: Kesion CMS 4.0
'Email: service@kesion.com. QQ: 111394,9537636
'Web: http://www.kesion.com http://www.kesion.cn
'Copyright (C) Kesion Network All Rights Reserved.
'*************************************** *************
Dim KSCls
Set KSCls = New SiteIndex
KSCls. Kesion ()
Set KSCls = Nothing
Class SiteIndex
Private KS
Private From, gourl, sdomain, title, username
Private Sub Class_Initialize ()
If (Not Response. IsClientConnected) Then
Response. Clear
Response. End
End If
Set KS = New PublicCls
End Sub
Private Sub Class_Terminate ()
Call CloseConn ()
Set KS = Nothing
End Sub
Public Sub Kesion ()
From = LCase (Request. ServerVariables ("HTTP_HOST "))
Sdomain = LCase (KS. SSetting (15 ))
Sdomain = Replace (sdomain, "http ://","")
Sdomain = Replace (sdomain ,"/","")
Dim domain1, domain2
Domain = LCase (from)
Domain = Replace (domain, "http ://","")
Domain = Replace (domain ,"/","")
If sdomain = domain and sdomain <> "" then
Title = KS. Setting (1) & "-personal space"
Gourl = "space/index. asp"
Else
Domain1 = Replace (Left (domain, InStr (domain ,".")),".","")
If Trim (domain1) = "" or domain1 = "www" Then Response. Redirect ("index. asp"): Response. End
Dim rs: set rs1_conn.exe cute ("select username, blogname from ks_blog where [domain] = '" & KS. R (domain1 )&"'")
If rs. eof and rs. bof then
Rs. close: set rs = nothing
'================================== Here, the second-level domain name redirection of non-personal spaces of other systems is defined, for example, Forum ================================
If instr (Request. ServerVariables ("SERVER_NAME"), "bbs.kesion.com")> 0 then
Response. redirect "bbs/index. asp"
Elseif instr (Request. ServerVariables ("SERVER_NAME"), "news.kesion.com")> 0 then
Response. redirect "news /"
Elseif instr (Request. ServerVariables ("SERVER_NAME"), "help.kesion.com")> 0 then
Response. redirect "help /"
Else
Response. redirect "index. asp"
End if
'================================================ ============================================
Exit sub
End if
Title = rs ("blogname ")
Domain1 = rs ("username ")
Rs. close: set rs = nothing
Domain2 = Right (domain, Len (domain)-InStr (domain ,"."))
Gourl = "space/space. asp? Username = "& domain1
End if
Response. Write ("Response. Write ("<meta http-equiv =" "Content-Type" "content =" "text/html; charset = gb2312" "/>") & vbcrlf
Response. Write ("<title>" & title & "</title>") & vbcrlf
Response. Write ("Response. Write ("Response. Write ("<frameset> <frame src =" & gourl & ""> </frameset> ")
End Sub
End Class
%>