Hello, how do I configure the .htaccess file so I allow access control?
I have a .JSON file which I want to fetch, but I’m getting this error in console:
TypeError: “NetworkError when attempting to fetch resource.” [debugger eval code:5:25](chrome://devtools/content/webconsole/debugger eval code)
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://scriptdownload.epizy.com/itemNamesToIds.json. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).
Edit: I used to do hotlinks from my site by discord.js and not discord itself. Some sites are not able to access this security system. Google is allowed.
AJAX and file downloads from other websites are blocked on the server level. You can try to make your website return different CORS headers, but the server will prevent them from actually being executed.
Also, looking at your domain name, I would like to remind you that InfinityFree is a website hosting service. That means we provide hosting for websites which are viewed in browsers. We don’t provide a free file sharing or file distribution service.