Access-Control-Allow-Origin header headers do not work

Although I added this to my .htaccess file:

Header add Access-Control-Allow-Origin "*" 

And this is in my apache configuration: (inside section AND outside)

 <Files ~ "\.(gif|jpe?g|png|js|json|xml)$"> Header set Access-Control-Allow-Origin "*" </Files> 

It still doesn't work!

When I get DIRECTORY, it gives me the desired header, but as soon as I upload a specific file, the header will not be found anywhere!

How hard is it to be?

+4
source share
1 answer

to try

 <FilesMatch "\.(gif|jpe?g|png|js|json|xml)$"> <IfModule mod_headers.c> Header set Access-Control-Allow-Origin "*" </IfModule> </FilesMatch> 
+1
source

All Articles