首页 优化推广 如果空间可以绑定多个域名,但不支持绑定子目录,实现跳转的方法

如果空间可以绑定多个域名,但不支持绑定子目录,实现跳转的方法

来源: | 时间:2011/3/6 21:38:47 |

Copy code
<script>try { if( self.location == "[url=http://bnnb.net/]http://bnnb.net/[/url][/url]" ) {  
top.location.href = "[url=http://bbs.xxxx.net/]http://bbs.xxxx.net/[/url][/url]";  
}  
else if( self.location == "[url=http://www.xxxx.cn/]http://www.xxxx.cn/[/url][/url]" ) {  
top.location.href = "[url=http://wwwxxxx.net]http://wwwxxxx.net[/url][/url]";  
}  
else {  
top.location.href = "[url=http://www.xxxx.net/]http://www.xxxx.net/[/url][/url]";  
} } catch(e) { }</script>

一共三层,每层第一个url是你绑定到空间的域名,第二个url是实现跳转到的目标文件夹或者其他网址。绑定到空间但是没在代码里设置的,统统跳转到第三层的那个网址
其中第二层的
Copy codeelse if( self.location == "[url=http://www.xxxx.cn/]http://www.xxxx.cn/[/url][/url]" ) {  
top.location.href = "[url=http://www.xxxx.net]http://www.xxxx.net[/url][/url]";  
}  


可以多次重复,格式一样.
把这些代码做成一个html,放到你空间根目录就行了,这个跳转目标url的效果跟解析的效果是一致的。

服务热线

153 8323 9821

功能和特性

价格和优惠

网站和维护

推广和优化

微信服务号