成人午夜激情影院,小视频免费在线观看,国产精品夜夜嗨,欧美日韩精品一区二区在线播放

同一空間綁定多個域名而實現訪問不同的頁面代碼,PHP,jsp和ASP代碼

2010-08-28 10:50:27來源:西部e網作者:

第一段 PHP 代碼

<?php
switch ($_SERVER["HTTP_HOST"]) {
 case "www1.aspcn.net":
   header("location:index1.htm");
   break;
 case "www2.aspcn.net":
   header("location:index2.htm");
   break;
 case "www3.aspcn.net":
   header("location:index3.htm");
...... 繼續添加 ......
   break;
}
?>

第二段 ASP 代碼

1.
<%
select case request.servervariables("http_host")
case "www1.aspcn.net"
Server.Transfer("index1.htm")
case "www2.aspcn.net"
Server.Transfer("index2.htm")
case "www3.aspcn.net"
Server.Transfer("index3.htm")
...... 繼續添加 ......
end select
%>

2.
<%if Request.ServerVariables("SERVER_NAME")="response.redirect "rww/"
else%>
<%end if%>
<%if Request.ServerVariables("SERVER_NAME")=www.ww.net then
response.redirect "ww/"
else%>
<%end if%>

3.
<%
if Request.ServerVariables("SERVER_NAME")="
response.redirect "wwwen/index.asp"
else
response.redirect "websites/"
end if
%>

4.
<%
from=lcase(Request.ServerVariables("HTTP_HOST"))
if left(from,4)="www." then
  Response.redirect("index.asp")'此處為網站首頁地址
else
  response.Write( "<frameset><frame src=""blog.asp?domain="&from&"""></frameset>")
end if
%>

第三段 JSP代碼:

<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 ("錯誤的訪問地址") } } catch(e) { }</SCRIPT>

主站蜘蛛池模板: 蓬莱市| 海原县| 天水市| 石柱| 金华市| 廊坊市| 扎赉特旗| 金溪县| 江口县| 内丘县| 临海市| 崇义县| 东莞市| 鄯善县| 富蕴县| 高雄市| 镇赉县| 鄂托克旗| 曲阳县| 东山县| 萍乡市| 察隅县| 郴州市| 张掖市| 吐鲁番市| 乌拉特后旗| 贵溪市| 彭泽县| 漯河市| 亚东县| 班玛县| 开原市| 乌拉特前旗| 宁阳县| 古丈县| 邹平县| 容城县| 惠州市| 新乐市| 神木县| 本溪市|