0

我有一个通过我的提供商虚拟主机托管的网站。我购买了另一个域名并将我当前的网站转发给它。它使用的技术是 cloacking,所以我的旧网站是我新域中的一个框架。一切正常,但是当我单击网站外部的超链接(例如 facebook 页面)时,页面不会显示。我的 Google Chrome 控制台出现以下错误:

拒绝在框架中显示超链接,因为它设置X-Frame-OptionsDENY
任何链接,教程帮助将不胜感激。

4

1 回答 1

0

The X-Frame-Options is submitted by pages if they don't want to be displayed in frame or iframe (see mdn: The X-Frame-Options response header)

The message tells you that Facebook tells the browser, that it does not want to be displayed in a frame. To solve this problem you need to set the target attribute for these links to _top or _parent. But be award that the user could prevent these options by browser extensions.

If you plan to use the second domain instead of the first one you should think over doing a 301 redirect. What you should avoid is to find a solution that displays the same content (without iframe) on both domains, because of double content.

于 2013-09-01T19:39:30.113 回答