网络编程
位置:首页>> 网络编程>> Asp编程>> 一空间多域名绑定不同目录方法

一空间多域名绑定不同目录方法

  发布时间:2009-03-09 18:32:00 

标签:域名,绑定,空间,代码

一空间多域名绑定3种方法,HTML代码格式:

<html>
<script language=javascript>
if(this.location=="https://www.aspxhome.com/")
{this.location.href="index1.htm";}
else
if(this.location=="http://aspxhome.com/")
{this.location.href="index1.htm";}
else
if(this.location=="http://www.cidianwang.com/")
{this.location.href="blog";}
else
if(this.location=="http://wendahu.com/")
{this.location.href="blog";}
</script>
</html>

ASP代码格式一:

<%
host=lcase(request.servervariables("HTTP_HOST"))
SELECT CASE host
CASE "cidianwang.com"
response.redirect "blog/"
CASE www.aspxhome.com
response.redirect "asp.asp"
CASE ELSE
response.redirect "index.htm"
END SELECT
%>

ASP代码格式二:

<%
      Dim StrDomain
            StrDomain=Request.ServerVariables("SERVER_NAME")
            '获得包含域名的字符串           
     select case StrDomain
              case "www.aspxhome.com"
                      Response.redirect "https://www.aspxhome.com/aaa/index.asp"    
              case "www.cidianwang.com"
                      Response.redirect "http://www.cidianwang.com/" 
              case else
                     Response.write "未知错误" 
     end select       
%>

 

0
投稿

猜你喜欢

手机版 网络编程 asp之家 www.aspxhome.com