Hyperlinks in a cloacked website

79 Views Asked by At

I have a website which is hosted via my providers webhosting. I have bought another domainname and forwarded my current website to it. The technique it uses is cloacking, so my old website is a frame in my new domain. Everything works perfectly but when I click a hyperlink that goes outside the website (e.g. facebook page), the page won't show. I have the following error in my Google Chrome console:

Refused to display Hyperlink in a frame because it set X-Frame-Options to DENY.
Any link, tutorial help will be appreciated.

1

There are 1 best solutions below

0
On

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.