0

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.

Filipe.Fonseca
  • 321
  • 2
  • 14

1 Answers1

1

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

shturm
  • 857
  • 7
  • 18
  • This one worked for me, but there is one more important thing: mod_headers was not installed. http://harthur.wordpress.com/2009/10/15/configure-apache-to-accept-cross-site-xmlhttprequests-on-ubuntu/ – Ivailo Petrov Ivanov Apr 16 '14 at 06:57