Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

210
Views
CORS / Access-Control-Allow-Origin

I have set up an API using php, so that other web sites can query a DB on one of my server. When I want to make a test with a client page, I get this:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://www.example.net/my.php?fx=221&ix=603. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).

.... .......
Reason: CORS header 'Access-Control-Allow-Origin' missing

I understand, according to this document, that I need to specify who is allowed to use the API.

Adding something like this:

Access-Control-Allow-Origin: https://amazing.site

But what is less clear is where I should add this.

Is it at the apache server level? Or is it in my php page on the server side? Any hint would be appreciated.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

In Apache/conf/httpd.conf add code of below:

<IfModule headers_module>
    Header set Access-Control-Allow-Origin "https://amazing.site"
</IfModule>

Make sure you have to uncomment of "LoadModule headers_module modules/mod_headers.so" in the same file.

You also can do it in every php file top:

header("Access-Control-Allow-Origin: https://amazing.site");
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!