Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/292.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 单击使用'的千斤顶保护;X-Frame-Options';?_Php_Html_Http Headers_Security - Fatal编程技术网

Php 单击使用'的千斤顶保护;X-Frame-Options';?

Php 单击使用'的千斤顶保护;X-Frame-Options';?,php,html,http-headers,security,Php,Html,Http Headers,Security,我想使用X-Frame-Options向我的网站添加点击劫持保护。 我网站中的几个页面显示在一个框架中,所以我想保护它们,但同时要正确地呈现它们。据我所知,我需要在X-Frame-Options值中使用SAMEORIGIN选项。但SAMEORIGIN到底是什么意思?是指同一个网站吗?我发现官方的描述不是很清楚,这是什么意思,2页共享相同的“来源”。。。 这里有人能帮我吗? 谢谢 来源是网站的方案+主机+端口。也就是说,http://example.com/的来源是(http,example.co

我想使用X-Frame-Options向我的网站添加点击劫持保护。 我网站中的几个页面显示在一个框架中,所以我想保护它们,但同时要正确地呈现它们。据我所知,我需要在X-Frame-Options值中使用SAMEORIGIN选项。但SAMEORIGIN到底是什么意思?是指同一个网站吗?我发现官方的描述不是很清楚,这是什么意思,2页共享相同的“来源”。。。 这里有人能帮我吗? 谢谢

来源是网站的方案+主机+端口。也就是说,
http://example.com/
的来源是
(http,example.com,80)
<代码>https://example.com/是另一个来源,即
(https,example.com,443)


为从
http://example.com/
表示只有
http://example.com/
将能够在一个框架中加载该页面。

使用X-frame-Options-customHeaders-将多个uri/域添加到web.config

解决方案->将其添加到web.config

 <httpProtocol>
        <customHeaders>
<add name="Content-Security-Policy" value="frame-ancestors 'self' website1.com website2.com;"/>
 </customHeaders>
      </httpProtocol>