While trying to fetch one of my files, I get the following error message:
Cross-Origin-Request blocked: the “Same Origin” politic doesn’t allow to read the distant resource located at Suspected phishing site | Cloudflare . Reason: missing CORS header “Access-Control-Allow-Origin”
Although I already had this problem for another fetch in the same webpage, that I fixed with setting up my .htaccess file as following:
Although it doesn’t work for this fetch, both being just as important, yet I am unable to put both files’ content into a single one, as one is for the webpage’s content, the other one for the website’s menu.
Anyone knowing how to fix this?
While the error indeed talks about CORS header issues, that’s not really what you should be paying attention to.
What you should pay attention to is the URL for which it is lacking the CORS header: https://infinityfree.net/errors/404. That’s not a page on your website. That’s our default “404 Page Not Found” error page.
So instead of trying to fix CORS errors, you should instead identify which URL is redirecting to our 404 page. Because this URL cannot be found. So the solution probably involves uploading or renaming files.
I did check for my URL quite a few time, and even after testing it (using WebStorm, as my browser doesn’t allow fetching local files for understandable security reasons), it always worked. Unless it is something with going back into folders that infinityfree’s system doesn’t allow? (the link is “…/index.json”)
I guess I’ll have to try doing otherwise with the link.
Ok may I say I’m just dumb, or blind?
I check the link a thousand times, but never did I realized that the file didn’t upload when I upload my folder (idk why, maybe multiple files with this name)
Anyway, in fact it was all good, just that somehow I wasn’t able to realize how stupid I am.
Thanks anyway for all you do!