X-Frame-Options SAMEORIGIN阻止我网域上的iframe [英] X-Frame-Options SAMEORIGIN blocking iframe on my domain
问题描述
我正在使用 http://www.jacklmoore.com/colorbox 在灯箱中显示网址的内容。
实现后,colorbox没有显示任何内容。
i'm using http://www.jacklmoore.com/colorbox to display the content of an url in a lightbox. after implementation, the colorbox did'nt showed anything.
后来,我注意到chrome日志中出现以下错误:
Later, i noticed the following error in chrome logs:
Refused to display document because display forbidden by X-Frame-Options.
所以在记录后我将以下行添加到网站的根.htaccess:
so after documenting i added the following line to the root .htaccess of the website :
Header always append X-Frame-Options SAMEORIGIN
允许iframe嵌入我自己的域。
to allow iframe embedding on my own domain.
但我仍然得到错误,我是x-frame的新手,而我我正在研究一个现有的应用程序,所以我认为.htaccess解决方案会很好,但它可以被某些代码覆盖吗?请注意,它不在服务器配置中。
But i still get the error, i'm newbie to x-frame, and i'm working on an existing application, so i thought the .htaccess solution would be nice, but can it be overrided by some code ? Notice that it's not in the server configuration.
推荐答案
尝试发送另一个X-Frame-Options标头,添加
Try sending another X-Frame-Options header, add
<?php header('X-Frame-Options: GOFORIT'); ?>
到页面顶部。
它应该禁用SAMEORIGIN命令。
to the top of your page. It should disable the SAMEORIGIN command.
这篇关于X-Frame-Options SAMEORIGIN阻止我网域上的iframe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!