请教高人,别的垃圾站域名指向到我的网站,我该怎么办(在线等待,急)

pulli 2008-12-07 02:26:38
最近建了个站www.edu72.com
是通过一个叫上海主机买的万网空间
最近发现一个域名soojoy.com也指向的是我的站
查了同IP下域名 果然有这个
但奇怪的是 为什么打开这个网站进入的是我的站点
不知道它这样做有什么意义
搜索才发现这是一个通过诱惑做火狐推介的
给万网打电话 他们竟说解析到什么地方是用户的自由 就是指向新浪都可以
对于我的问题 他们无能无力
问了很多人 都无法解决
真不知该如何?
...全文
202 5 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
haiyun365 2008-12-07
  • 打赏
  • 举报
回复
可以用一个主机头判断 没分 自己看代码

ASP/PHP实现主机头多域名转向的方法
ASP:
1.使用CASE语句,缺点:同一域名即@和www需要两次循环,代码显重复<%
host=lcase(request.servervariables("HTTP_HOST"))
select CASE host
CASE "www.abc.com"
response.redirect "index.htm"
CASE "abc.com"
response.redirect "index.htm"

CASE ELSE
response.redirect "other.htm"
END select
%>
--------------------------
<%if instr(Request.ServerVariables
("SERVER_NAME"),"kekexi.com")>0 then
response.redirect "index.asp"
else if instr(Request.ServerVariables
("SERVER_NAME"),"4668.com")>0 then
response.redirect "x/index.asp"
else if instr(Request.ServerVariables
("SERVER_NAME"),"web315.com")>0 thenr
esponse.redirect "index3.asp"
end if
end if

-----------------------
<%if Request.ServerVariables("SERVER_NAME")="www.yyjs.com" then
response.redirect "zkj"
else
response.redirect "i.htm"
end if%>

----------------------------
<%if Request.ServerVariables("SERVER_NAME")="www.yyjs.com" then
response.redirect "index1.asp"
else if Request.ServerVariables("SERVER_NAME")="www.ce.org.cn" then
response.redirect "index2.asp"
else if Request.ServerVariables("SERVER_NAME")="www.163.com" then
response.redirect "index3.asp"
end if
end if
end if%>
2.为解决上述问题,可以加条件判断加上www. 这样就可以自动识别www前缀:
<%
dim domain
domain=request.ServerVariables("Server_Name")
if instr(domain,"www.") then domain=right(domain,len(domain)-4)
if domain="abc.com" then
response.redirect "1/"
elseif domain="123.com" then
response.redirect "2/"
else
response.redirect "3/"
end if
%>
3.

====================================
PHP:
1.多个
<?php
$domain_net="abc.com";
$dot_net_url="目录1/";
$dot_com_url="目录2/";
if(($HTTP_HOST=="$domain_net")or($HTTP_HOST=="www.$domain_net"))
{
Header("Location: $dot_net_url");
}
else
{
Header("Location: $dot_com_url");
}
?><?php
switch ($_SERVER["HTTP_HOST"]) {
case "ychon.org":
header("location:bbs");
break;
default:
header("location:news");
break;
}
?>
2.单个 <?
Header("Location: [url]http://www.ychon.org");
?>
或:
<?
echo "<meta http-equiv=refresh content='0; url=http://www.ychon.org'>";
?>
还可以这样用:
<?
header("refresh:3;url=http://web.com");
?>
注意:使用Header函数时必须网页未产生任何输出,此时尤其要注意空格的问题。即必须放在网页最开始处。
====================================
Java Script :
<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>

-------------------------------------
<script language="javascript">
switch (window.location.hostname) {
case "test" ://确定玉米为TEST
window.location.pathname="1"//跳转到1目录
break;
case "127.0.0.1" ://确定玉米为127.0.0.1
window.location.pathname="2"//跳转到2目录
break;
//依次类推写下去
default ://如果没有找到该玉米
window.location.pathname="3"//跳转到3目录
}
</script>

location对象有以下几个属性:

hash 设置或获取 href 属性中在井号“#”后面的分段。
host 设置或获取 location 或 URL 的 hostname 和 port 号码。
hostname 设置或获取 location 或 URL 的主机名称部分。
href 设置或获取整个 URL 为字符串。
pathname 设置或获取对象指定的文件名或路径。
port 设置或获取与 URL 关联的端口号码。
protocol 设置或获取 URL 的协议部分。
search 设置或获取 href 属性中跟在问号后面的部分。
smartcatiboy 2008-12-07
  • 打赏
  • 举报
回复
这么好的事,楼主还发愁。。。。

羡慕啊。
-晴天 2008-12-07
  • 打赏
  • 举报
回复
你应该热烈欢迎才对.俺们都在为流量发愁呢!
鸣宇淳 2008-12-07
  • 打赏
  • 举报
回复
挺好的呀,不期望要是全世界的域名都指向我的网站,有一亿分之一指向我的网站那就好了。
sayfree 2008-12-07
  • 打赏
  • 举报
回复
这是好事啊。别人的域名指到你的网站上。不过话说回来了。不是说域名指到哪里,就是能打开哪里的网站。还需要添加主机头。所以,你跟空间商联系一下,估计是空间商建站点的时候弄错了。

28,409

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧