Allowing Cross Origin Requests using htaccess

Posted on 29-03-2017 by Nadir Latif


Source: http://stackoverflow.com/questions/14467673/enable-cors-in-htaccess

htaccess directives can be used to allow requests from different domains. For example the following directives added to htaccess file should allow access from any domains:


Header add Access-Control-Allow-Origin "*"
Header add Access-Control-Allow-Headers "origin, x-requested-with, content-type"
Header add Access-Control-Allow-Methods "PUT, GET, POST, DELETE, OPTIONS"