I have a strange behavior and can’t find any solution despite many many attempts (too many hours) .
So I decide to set up a very simple example on a personal domain (can’t communicate the URLs of my WIP project) !
This domain is behind Cloudflare and the web page simply make 2 POST Ajax calls to 2 differents subdomains.
First one : https://demo1.rpgmax.fr/
Domain behind Cloudflare.
Second one : https://demo2.rpgmax.fr/
Installed on Cloudflare but on “bypass” mode.
Both domains use the same folder (and webpage) on the back office server.
Go to : https://test.rpgmax.fr/
F12 + check network requests and console log.
The first AJAX request failed with a CORS error + a 307 redirect.
The second AJAX request is 100% OK with no CORS error + a 200 response code.
CORS policy is OK on the “2 subdomains” (remember same folder/script behind) with a “full access” rule : Access-Control-Allow-Origin: * (look at the headers).
How do I get demo1.rpgmax.fr to work too ?
Note : On my WIP project I use more complexed scripts + the usual OPTIONS request that is OK (code 200) + the POST request with the same behavior (307 redirect + CORS error).
Thank you !