我正在尝试添加我的表达式引擎网站的头,但没有得到确切的我可以。我有格式的头在php
{exp:http_header Feature-Policy="sync-xhr \'self\' https://example.com"}
{exp:http_header x_content_type_options="nosniff"}这是我在php中的头文件:
<?php
header('Strict-Transport-Security: max-age=454556000; includeSubDomains');
header('Content-Security-Policy: default-src \'self\'');
header('Feature-Policy: sync-xhr \'self\' https://example.com');
header('X-Frame-Options: SAMEORIGIN');
header('X-Xss-Protection: 1; mode=block');
header('X-Content-Type-Options: nosniff');
header('Referrer-Policy: strict-origin');
?>我想添加像上面的样本,我附上。
{exp:http_header Feature-Policy="sync-xhr \'self\' https://example.com"}
{exp:http_header x_content_type_options="nosniff"}如何添加: header('Strict-Transport-Security: max-age=454556000;includeSubDomains');
在表达式引擎中?
提前感谢您的帮助。
发布于 2019-07-15 18:07:21
你激活了"HTTP Header“插件了吗?
发布于 2021-05-31 22:25:09
是的,"HTTP Header“是EE的默认插件。如果要使用HTTP头标记,则必须安装此插件。添加$config['allow_php'] = 'y';以启用php。为特定模板启用php。
https://stackoverflow.com/questions/56735477
复制相似问题