多域名綁定到一個(gè)空間訪問(wèn)不同首頁(yè)的技巧
當(dāng)前位置:點(diǎn)晴教程→知識(shí)管理交流
→『 技術(shù)文檔交流 』
將多個(gè)域名綁定到一個(gè)空間,訪問(wèn)不同的首頁(yè)。這樣設(shè)立更多的子站點(diǎn):)
空間內(nèi)默認(rèn)首頁(yè)(通常是 index.asp 或 default.asp )使用 Request.ServerVariables("HTTP_HOST") 獲取用戶訪問(wèn)時(shí)所使用域名,然后使用 Select 調(diào)用不同文件,可用 Response.Redirect 或 Server.Transfer 復(fù)制代碼 代碼如下: Dim cc_str_host_name cc_str_host_name = LCase(Request.ServerVariables("HTTP_HOST")) '判斷主機(jī)名進(jìn)行跳轉(zhuǎn) Select Case cc_str_host_name Case "www.kuozhanming.com" Server.Transfer "main.asp" Case "www.suoxie.com" Server.Transfer "main_2.asp" Case Else Server.Transfer "main_3.asp" End Select 該文章在 2011/2/16 9:12:00 編輯過(guò) |
關(guān)鍵字查詢
相關(guān)文章
正在查詢... |