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.
The
X-Frame-Optionsis submitted by pages if they don't want to be displayed inframeoriframe(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
targetattribute for these links to_topor_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
301redirect. What you should avoid is to find a solution that displays the same content (withoutiframe) on both domains, because of double content.