【发布时间】:2021-02-02 02:11:02
【问题描述】:
我有一个网站,我想让它显示在另一个域的 iframe 中。 我正在使用 PHP 标头来允许这样做。但是,我只想让我的网站在特定页面上运行,而不是在整个域上运行。
我有这个代码:header ("Content-Security-Policy: frame-ancestors https://example.com/");
我只想允许一个特定的 URL(例如:https://example.com/example.php),但实际上整个域都可以在 iframe 中显示我的网站。
提前致谢!
【问题讨论】:
标签: php html iframe content-security-policy