我想通过 htaccess 向我的网站添加授权。
我添加了这段代码:
# BEGIN Cache-Control Headers
<ifmodule mod_headers.c>
Header set Access-Control-Allow-Origin: https://www.example.com
Header set Access-Control-Allow-Headers: Special-Request-Header
Header set Access-Control-Allow-Credentials: true
Header set Access-Control-Max-Age: 240
</ifmodule>
# END Cache-Control Headers
但是Internal Server Error
当我尝试添加以下行时,网站给出了:
Header set Access-Control-Allow-Methods: PUT, POST, OPTIONS
需要特殊授权还是语法错误?