佳木斯湛栽影视文化发展公司

主頁(yè) > 知識(shí)庫(kù) > 多中語(yǔ)言實(shí)現(xiàn)判斷客戶訪問(wèn)用得是那個(gè)域名 然后轉(zhuǎn)到對(duì)應(yīng)的目錄

多中語(yǔ)言實(shí)現(xiàn)判斷客戶訪問(wèn)用得是那個(gè)域名 然后轉(zhuǎn)到對(duì)應(yīng)的目錄

熱門(mén)標(biāo)簽:美圖手機(jī) 服務(wù)器配置 檢查注冊(cè)表項(xiàng) 智能手機(jī) 鐵路電話系統(tǒng) 銀行業(yè)務(wù) 呼叫中心市場(chǎng)需求 網(wǎng)站文章發(fā)布

多中語(yǔ)言實(shí)現(xiàn)判斷客戶訪問(wèn)用得是那個(gè)域名 然后轉(zhuǎn)到對(duì)應(yīng)的目錄 
asp版:

發(fā)表多個(gè)綁定多域名的ASP代碼

如果有有一個(gè)ASP空間,而你又想放置多個(gè)多個(gè)站點(diǎn),這些代碼可以幫到你
第一個(gè) 
%if Request.ServerVariables("SERVER_NAME")="bbs.along.com.ru" then
response.redirect "bbs"
else
response.redirect "index1.htm"
end if%>

第二個(gè)
%
select case request.servervariables("http_host")
case "www.along.com.ru" '1
Server.Transfer("along.htm")
case "www.along.net.ru" '2
Server.Transfer("net.htm")
case "www.null.com.ru" '3
Server.Transfer("null.htm")
...... 繼續(xù)添加 ......
end select
%>

第三個(gè)
%if instr(Request.ServerVariables
("SERVER_NAME"),"fjsky.info")>0 then
response.redirect "index.asp"
else if instr(Request.ServerVariables
("SERVER_NAME"),"along.com.ru")>0 then
response.redirect "x/index.asp"
else if instr(Request.ServerVariables
("SERVER_NAME"),"along.net.ru")>0 thenr
esponse.redirect "index3.asp"
end if
end if
end if%>

第四個(gè)
%if Request.ServerVariables("SERVER_NAME")="www.fjsky.info" then
response.redirect "main1.asp"
else if Request.ServerVariables("SERVER_NAME")="fjsky.info" then
response.redirect "main1.asp"
else if Request.ServerVariables("SERVER_NAME")="www.null2.com.ru" then
response.redirect "/web/index.asp"
else if Request.ServerVariables("SERVER_NAME")="null2.com.ru" then
response.redirect "/web/index.asp"
end if
end if
end if
end if%>

第五個(gè)

'取得HTTP輸入的值并付值到HTOST中
host=lcase(request.servervariables("HTTP_HOST"))
'開(kāi)始條件跳轉(zhuǎn)
SELECT CASE host
' 如果HOST的值是www.iswind.net就選擇事件case"www.iswind.net"的命令
CASE "www.abc.net"
' Below is the redirect command
response.redirect "web/"
CASE "www.efd.com"
response.redirect "web1/"
'We use CASE ELSE to fix any other requests
CASE ELSE
response.redirect "web1/"
END SELECT 
%> 

js版:
script>
try 
{ if( self.location == "http://玉米一/" ) 
{
top.location.href = "http://玉米一/目錄";
}
else if( self.location == "http://玉米二/" ) 
{
top.location.href = "http://玉米二/目錄";
}
else if( self.location == "http://玉米三/" ) 
{
top.location.href = "http://玉米三/目錄";
}
else if( self.location == "http://玉米四/" ) 
{
top.location.href = "http://玉米四/目錄";
}
else 
{ document.write ("錯(cuò)誤的訪問(wèn)地址") } 

catch(e) { }
/script> 




case "domain.com":
header("location:blog");
break;
default:
header("location:news");
break;
}
?>

或者

?php
$domain_net="yeahe.com";
$dot_net_url="bbs/";
$dot_com_url="flash";
if(($HTTP_HOST=="$domain_net")or($HTTP_HOST=="www.$domain_net"))
{
Header("Location: $dot_net_url");
}
else
{
Header("Location: $dot_com_url");
}
?>

標(biāo)簽:河南 長(zhǎng)治 新疆 滄州 紅河 樂(lè)山 沈陽(yáng) 上海

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《多中語(yǔ)言實(shí)現(xiàn)判斷客戶訪問(wèn)用得是那個(gè)域名 然后轉(zhuǎn)到對(duì)應(yīng)的目錄》,本文關(guān)鍵詞  ;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問(wèn)題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無(wú)關(guān)。
  • 相關(guān)文章
  • 收縮
    • 微信客服
    • 微信二維碼
    • 電話咨詢(xún)

    • 400-1100-266
    玛曲县| 会泽县| 黑龙江省| 苏尼特左旗| 霍山县| 大港区| 莫力| 卓资县| 临沧市| 新乡市| 河间市| 聂荣县| 鞍山市| 新津县| 长白| 峨边| 黄山市| 五莲县| 广灵县| 寿光市| 揭阳市| 车致| 比如县| 西华县| 团风县| 鹤山市| 武胜县| 宁南县| 克东县| 尼勒克县| 周至县| 濮阳县| 府谷县| 永州市| 武强县| 洛宁县| 翁牛特旗| 忻城县| 象州县| 盐山县| 同仁县|