.htaccess中的标题集Access-Control-Allow-Origin不起作用
我不明白为什么我的.htaccess标题设置不起作用。 我的.htaccess文件内容: Header set Access-Control-Allow-Origin * Header always set Access-Control-Allow-Methods "POST, GET, OPTIONS, DELETE, PUT" Header always set Access-Control-Allow-Headers "*" RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php [QSA,L] 但是,当我删除Header并将它们添加进来时,index.php一切正常。 header("Access-Control-Allow-Origin: *"); header("Access-Control-Allow-Methods: PUT, GET, POST, DELETE, OPTIONS"); header("Access-Control-Allow-Headers: *"); 我想念什么?