一个空间绑定多个域名实现自动跳转的几种方法!
给出我自己使用的代码,比如:我有域名1;域名2!
我想域名直接访问blog/index.php
域名2只访问首页index1.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>跳转页面</title>
</head>
<script language="javascript">
if(location.toString().indexOf("域名1")!= -1)
{
location.href="blog/index.php"
}
</script>
<meta http-equiv="refresh" content="1;URL=index1.html" />
<body>
</body>
</html>
即可实现!
本人只是菜鸟,如果不对之处,请大家口下留情!
第一个
程序代码
<%
if Request.ServerVariables("SERVER_NAME")="www.1xx.com" then
response.redirect "williamlong/index.htm"
else
response.redirect "index2.htm"
end if