CORS apache linux Access-Control-Allow-Origin "*"

May 16, 2015 10k views
Apache DigitalOcean Configuration Management

Can´t make Access-Control-Allow-Origin "" working, I have done the setup for making .htaccess working right, I know it´s working right because ErrorDocument 404 is working perfect, but: Header set Access-Control-Allow-Origin "" is not. I have added Header set Access-Control-Allow-Origin "*" inside etc/apache2/sites-available/000-default.conf but nothing, can you help me with this? thanks, I have read all the related support about this, tried everything but nothing.

2 Answers

The mod_headers module could be disabled. Try enabling it and reload Apache.

sudo a2enmod headers
sudo service apache2 reload

If you still don't see the header try adding it to your .htaccess file:

Header set Access-Control-Allow-Origin "*"
Have another answer? Share your knowledge.