How to enable "Access-Control-Allow-Origin: * header of my website?

Hello,

I am working on a project hosted on GitHub, and it loads files from your hosting. However, I am encountering a CORS (Cross-Origin Resource Sharing) issue when trying to load files from my hosting account. This issue also occurs when testing the project locally on localhost.

Could you please assist me by enabling CORS for my account so that files can be accessed from my GitHub project, as well as when working with the project locally on localhost, without any restrictions?

Specifically, I need the following:

Allow access to files from my GitHub project and from localhost for files hosted on your server.
Ensure that these files can be loaded correctly from the GitHub domain and from localhost.
Please let me know if any further configuration is required on my end.

Thank you in advance for your assistance, and I look forward to your response.

Best regards,
SerYak

Hello! Welcome to the forum!

Unfortunately, that’s not possible because of this:

Infinityfree expects you to use your website as a web hosting service, not as a file hosting one. Therefore, they take measures to ensure that only web browsers are reaching your website.

What exactly are you trying to load and for what purpose? You may be able to either
a) move the files stored with Infinityfree elsewhere that is designed for your use-case or
b) move the GitHub project over to Infinityfree, provided that it’s a website and follows InfinityFree’s ToS.

If there’s anything else you want to ask, let us know!

9 Likes

I am surprised that CORS is needed for video and audio files that are loaded for the audio/video HTML5 tag via the src attribute. Thank you for the answer!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.