有两个域名指向KT同一网站,同一空间,一个指向根目录,一个指向二级内目录,问题出来了。。。
我的要求是: www.nikeexpert.com 指向 /index.html www.cheap-belt.com 指向 /cheap_wholesale_authentic/Belt_1.html
代码如下一:
<script>
function btnClick()
{
var url = document.all("url").value;
var da = "www.nikeexpert.com"
var xiao = "www.cheap-belt.com"
if(url==da)
document.location.href="http://www.nikeexpert.com"
else if(url==xiao)
document.location.href="http://cheap-belt.com/cheap_wholesale_authentic/Belt_1.html"
else
return false;
return true;
}
</script>
<input type=txt name=url id=url value="">
<input type=button value=Enter OnClick="return btnClick()">
代码如下二:
<%
Domain_Name=Request.ServerVariables("HTTP_HOST")
Select Case Domain_Name
Case " www.nikeexpert.com" Response.Redirect("/index.html")
Case " www.cheap-belt.com" Response.Redirect("/cheap_wholesale_authentic/Belt_1.html")
Case Else Response.Redirect("index.asp")
End Select
%>
参考代码三:
<?php
switch ($_SERVER["HTTP_HOST"])
{
case "asdf.com":
header("location:index.html");
break;
case " www.asdf.com":
header("location:index.html");
break;
case "asdf.cn":
header("location:index_cn.html");
break;
case " www.asdf.cn":
header("location:index_cn.html");
break;
}
?>
ASP
<%
host=lcase(request.servervariables("HTTP_HOST"))
'开始条件跳转
SELECT CASE host
CASE "blog.it19.cn"
response.redirect "/blog/"
CASE "bbs.it19.cn"
response.redirect "/bbs/"
case "cyle.it19.cn"
response.redirect "/cyle/"
case "www.it19.cn"
response.redirect "/cyle/"
CASE ELSE
response.redirect "/main/"
END SELECT
%>
<script>
function Getdomain(){
<!--
DocURL = document.URL;