专业网站建设品牌,十四年专业建站经验,服务6000+客户--广州京杭网络
免费热线:400-683-0016      微信咨询  |  联系我们

X-Frame-Options SAMEORIGIN阻止我网域上的iframe(X-Frame-Options SAMEORIGIN blocking

当前位置:网站建设 > 技术支持
资料来源:网络整理       时间:2023/2/14 0:40:08       共计:3656 浏览

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.

Later, i noticed the following error in chrome logs:

Refused to display document because display forbidden by X-Frame-Options.

so after documenting i added the following line to the root .htaccess of the website :

Header always append X-Frame-Options SAMEORIGIN

to allow iframe embedding on my own domain.

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.

解决方案

Try sending another X-Frame-Options header, add

<?php header('X-Frame-Options: GOFORIT'); ?>

to the top of your page. It should disable the SAMEORIGIN command.

我正在使用 http://www.jacklmoore.com/colorbox 在灯箱中显示网址的内容。
实现后,colorbox没有显示任何内容。



后来,我注意到chrome日志中出现以下错误:



 拒绝显示文档,因为X-Frame-Options禁止显示。 
  


所以在记录后我将以下行添加到网站的根.htaccess:



 标题总是附加X-Frame-Options SAMEORIGIN 
  


允许iframe嵌入我自己的域。



但我仍然得到错误,我是x-frame的新手,而我我正在研究一个现有的应用程序,所以我认为.htaccess解决方案会很好,但它可以被某些代码覆盖吗?请注意,它不在服务器配置中。


解决方案

尝试发送另一个X-Frame-Options标头,添加



 <?php header('X-Frame-Options:GOFORIT'); ?> 
  


到页面顶部。
它应该禁用SAMEORIGIN命令。

版权说明:
本网站凡注明“广州京杭 原创”的皆为本站原创文章,如需转载请注明出处!
本网转载皆注明出处,遵循行业规范,如发现作品内容版权或其它问题的,请与我们联系处理!
欢迎扫描右侧微信二维码与我们联系。
·上一条:禁止网站被别人通过iframe引用 | ·下一条:IIS 配置禁止外部Iframe嵌套

Copyright © 广州京杭网络科技有限公司 2005-2025 版权所有    粤ICP备16019765号 

广州京杭网络科技有限公司 版权所有