源码网,源码论坛,源码之家,商业源码,游戏源码下载,discuz插件,棋牌源码下载,精品源码论坛

 找回密码
 立即注册
查看: 525|回复: 12

[CSS/HTML] 多中语言实现判断客户访问用得是那个域名 然后转到对应的目录

[复制链接]

7万

主题

861

回帖

32万

积分

论坛元老

Rank: 8Rank: 8

积分
329525
发表于 2007-5-11 00:00:00 | 显示全部楼层 |阅读模式

多中语言实现判断客户访问用得是那个域名 然后转到对应的目录 
asp版:

发表多个绑定多域名的ASP代码

如果有有一个ASP空间,而你又想放置多个多个站点,这些代码可以帮到你
第一个 
<%if Request.ServerVariables("SERVER_NAME")="bbs.along.com.ru" then
response.redirect "bbs"
else
response.redirect "index1.htm"
end if%>

第二个
<%
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")
...... 继续添加 ......
end select
%>

第三个
<%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%>

第四个
<%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%>

第五个
<% 
'取得HTTP输入的值并付值到HTOST中
host=lcase(request.servervariables("HTTP_HOST"))
'开始条件跳转
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 ("错误的访问地址") } 

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");
}
?>

回复

使用道具 举报

1

主题

1万

回帖

207

积分

中级会员

Rank: 3Rank: 3

积分
207
发表于 2022-11-26 13:32:30 | 显示全部楼层
dfdsafdsfdsfdsf
回复 支持 反对

使用道具 举报

2

主题

1万

回帖

146

积分

注册会员

Rank: 2

积分
146
发表于 2022-12-6 02:33:13 | 显示全部楼层
抽根烟,下来看看再说
回复 支持 反对

使用道具 举报

3

主题

1万

回帖

172

积分

注册会员

Rank: 2

积分
172
发表于 2023-7-1 23:29:57 | 显示全部楼层
dfdsafdsfdsfdsf
回复 支持 反对

使用道具 举报

27

主题

1万

回帖

331

积分

中级会员

Rank: 3Rank: 3

积分
331
发表于 2023-8-21 13:37:24 | 显示全部楼层
啦啦啦啦啦德玛西亚
回复 支持 反对

使用道具 举报

0

主题

1万

回帖

0

积分

中级会员

Rank: 3Rank: 3

积分
0
发表于 2023-8-24 07:40:41 | 显示全部楼层
大家都不容易!
回复 支持 反对

使用道具 举报

0

主题

1万

回帖

0

积分

中级会员

Rank: 3Rank: 3

积分
0
发表于 2023-10-16 17:37:57 | 显示全部楼层
哦哦哦ijhhsdj
回复 支持 反对

使用道具 举报

29

主题

1万

回帖

194

积分

注册会员

Rank: 2

积分
194
发表于 2023-11-7 10:07:55 | 显示全部楼层
天天源码社区www.tiantianym.com
回复 支持 反对

使用道具 举报

2

主题

1万

回帖

73

积分

注册会员

Rank: 2

积分
73
发表于 2023-11-7 19:37:06 | 显示全部楼层
的沙发水电费水电费
回复 支持 反对

使用道具 举报

27

主题

1万

回帖

331

积分

中级会员

Rank: 3Rank: 3

积分
331
发表于 2024-4-29 14:54:20 | 显示全部楼层
大家都不容易!
回复 支持 反对

使用道具 举报

高级模式
B Color Image Link Quote Code Smilies

本版积分规则

手机版|小黑屋|网站地图|源码论坛 ( 海外版 )

GMT+8, 2024-9-20 09:01 , Processed in 0.083562 second(s), 26 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表