Question

I'm trying to make cross domain request to xml file. In .htaccess I have

<IfModule mod_headers.c>
    Header set Access-Control-Allow-Origin "*"
</IfModule>

and in apache2/sites-available/default

<Directory />
    Options FollowSymLinks
    AllowOverride All
    Order allow,deny
    allow from all
</Directory>

but I still receive the

No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '*' is therefore not allowed access.

Was it helpful?

Solution

Edditing as follows, applying your paths:

<Directory /var/www/>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    allow from all
</Directory>

And make sure you have the right virtual hosts config you're editing. E.g. apache2/sites-available/myVirtualWebsite.com

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top