0

我想在 httpd 的 Header set X-Frame-Options "ALLOW-FROM " 中添加多个域/URL(例如:Header set X-Frame-Options "ALLOW-FROM http://xyz , http://abc ") .conf 文件。但我无法添加上面指定的 2 个域/URL。我的要求是仅当从 2 个不同的域访问该页面时才应显示 X-Frame 内容。所以很明显我不能给SAMEORGIN。请指定任何替代解决方案以在 X-Frame-Options 中添加 2 个域/URL。

4

1 回答 1

2

将此添加到您的 apache 配置中:

<IfModule mod_headers.c>

    Header set Content-Security-Policy "frame-ancestors http://*.example.com/ 'self';"

    # For IE 11 and below
    Header set X-Frame-Options SAMEORIGIN
    Header append X-Frame-Options "ALLOW-FROM http://example.com/" </IfModule>
于 2018-04-18T08:40:34.577 回答