可能阻止我们的网站在另一个域的框架集或IFrame中运行? [英] Possible to prevent our website from running inside another domain's frameset or IFrame?

查看:150
本文介绍了可能阻止我们的网站在另一个域的框架集或IFrame中运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我们一直在出现问题,其他网站正在我们的电子商务网站上运行我们的电子商务网站,其中我们的网站(违法者的会员身份被贴上)是唯一的全幅框架内容。所以基本上它看起来像我们的网站,他们的网址在顶部。我们可以切断他们的会员身份,这对他们来说是毫无意义的,但这并不能阻止未来的罪犯在我们发现之前做同样的事情。



是否有通用的方式(通过每个页面上出现的JavaScript?),以防止发生这种情况?请注意,将目标添加到所有链接是不可行的,但是将JS代码片段添加到所有页面都是,因为页眉和页脚部分是从单个源共享的。



另一个可能性是在Apache级别(如果有什么我们可以做服务器端),因为我们通过mod-rewrite传递所有请求。



请注意,如果父页面来自我们的域,则允许页面加载到IFrame内,因为我们有效使用IFrames

解决方案

您可以使用javascript进行拼写检查。我相信这仍然适用于iFrame。



http://www.quirksmode.org/js/framebust.html


We've been having an problem recently where other sites are running our e-commerce site inside a frameset where our site (with the offenders affiliate id tacked on) is the only content in a single full width frame. So essentially it looks and feels like our site with their URL at the top. We can cut off their affiliate id, which would make it pointless for them to do, but this doesn't prevent future offenders from doing the same thing until we find out about it.

Is there a generic way (through JavaScript that appears on every page perhaps?) to prevent this from happening? Note that adding targets to to all links is not feasible, but adding a snippet of JS to all pages is, since the header and footer portions are shared sitewide from a single source.

Another possibility would be at the Apache level (if there is anything we could do server side) as we do pass all requests through mod-rewrite.

Note that it would be essential to sill allow pages to load inside an IFrame if the parent page originates from our domain, as we make valid use of IFrames

解决方案

You can use javascript to do framebusting. I believe this still works for an iFrame.

http://www.quirksmode.org/js/framebust.html

这篇关于可能阻止我们的网站在另一个域的框架集或IFrame中运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆