If you are trying to run two different servers on the same machine and trying to access each other through HTTP request, you might get a CORS error.

Something like this in Firefox:

and this error in Google Chrome:


To solve this – first you need enable module “headers” on the server which is responding.

For Apache you run the following and restart the server:

next add the following to your .htaccess file


 

Nandini is a Web Developer and a blogger who loves tinkering with new technologies, frameworks and devices. When not in front of her computer she likes to travel, read and spend time gardening.

Enabling CORS in Apache: Solve Cross-Origin Request Blocked error
Tagged on:         

Leave a Reply

Your email address will not be published. Required fields are marked *