In the .htaccess file on my web server, I have the following CORS header set:
Header set Access-Control-Allow-Origin "example.com"
In one of my PHP scripts, that I frequently call while working from localhost, I have this header set:
header("Access-Control-Allow-Origin: *");
This has worked for me up until yesterday, when I turned on FPM for PHP. Now I get the following error:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://www.example.com/script.php. (Reason: CORS header 'Access-Control-Allow-Origin' does not match '*, example.com').
I'm only getting that error when calling from localhost, not while calling from the website. I'm wondering if there's a way to override the .htaccess
CORS header via PHP now that FPM is enabled.