全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别
查看: 4846|回复: 3

KT 2003操作系统,域名跳转问题

[复制链接]
发表于 2009-7-17 02:12:04 | 显示全部楼层 |阅读模式
有两个域名指向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;   
   
  protocolIndex=DocURL.indexOf("://",4);   
   
  serverIndex=DocURL.indexOf("/",protocolIndex   +   3);   
   
  BeginURL=DocURL.indexOf("#",1)   +   1;   
   
  displayresult=DocURL.substring(protocolIndex   +   3   ,serverIndex);   
   
  if   (displayresult=="www.a.com")   
  {   
      document.write("www.a.com");   
  }   
                    else   if   (displayresult=="www.b.com")   
                    {   
                        document.write("www.b.com");   
                    }   
                    else   if   (displayresult=="www.c.com")   
                    {   
                        document.write("www.c.com");   
                    }   
  }   
  Getdomain();   
  //-->   
  </script>
不见效果,请高手们出来看看,郁闷中,特别是那个二层目录的指向好象都不行
发表于 2009-7-17 08:48:12 | 显示全部楼层
原帖由 baobao 于 2009-7-17 02:12 发表
有两个域名指向KT同一网站,同一空间,一个指向根目录,一个指向二级内目录,问题出来了。。。
我的要求是:  
www.nikeexpert.com   指向 /index.html
www.cheap-belt.com   指向 /cheap_wholesale_authentic/Belt_1.html
代 ...


这个要求在Linux Aapche下很容易实现,在Windows IIS下我还真不知道怎么弄。
 楼主| 发表于 2009-7-17 17:53:44 | 显示全部楼层
高手显身...
发表于 2009-7-17 18:05:34 | 显示全部楼层
原帖由 baobao 于 2009-7-17 17:53 发表
高手显身...


等待IIS高手
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2024-5-1 12:03 , Processed in 0.058038 second(s), 8 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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