PHP标头功能会覆盖htaccess标头吗?

时间:2019-03-11 13:27:39

标签: php

在PHP中设置标题

header("Access-Control-Allow-Origin: https://www.example.com");
header("Access-Control-Allow-Headers: Content-Type, Content-Range, Content-Disposition, Content-Description");

.htaccess中设置的标题

SetEnvIf Origin ^(https?://.+\.(example|gstatic)\.com(?::\d{1,5})?)$   CORS_ALLOW_ORIGIN=$1
Header append Access-Control-Allow-Origin  %{CORS_ALLOW_ORIGIN}e   env=CORS_ALLOW_ORIGIN

Header set Access-Control-Allow-Headers "origin, x-requested-with, content-type"
Header set Access-Control-Allow-Methods "PUT, GET, POST, DELETE, OPTIONS"

Header merge  Vary "Origin"

我不想编辑.htaccess文件。 PHP header()函数是否会覆盖。

0 个答案:

没有答案