Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have enabled mod_headers in my apache (2.2 on windows server 2008) config but it is not doing anything.

I have moved the headers directive to all parts of the config and even to a .htaccess file in the root and still it does nothing.

<VirtualHost *:80>

    ServerName [dedacted]
    ServerAdmin [dedacted]
    DocumentRoot "C:\data"

    Header always append Access-Control-Allow-Origin "*"

    ErrorLog "logs/data.log"
    CustomLog "logs/data.log" common

    <Directory C:\data>
        Options FollowSymLinks All
        AllowOverride All
        Order deny,allow
        Allow from all
    </Directory>

</VirtualHost>

I have checked the module is loaded via the command line and phpinfo(), see below:

Loaded Modules core mod_win32 mpm_winnt http_core mod_so mod_actions mod_alias mod_asis mod_auth_basic mod_authn_default mod_authn_file mod_authz_default mod_authz_groupfile mod_authz_host mod_authz_user mod_autoindex mod_cgi mod_dir mod_env **mod_headers** mod_include mod_isapi mod_log_config mod_mime mod_negotiation mod_rewrite mod_setenvif mod_php5 

Im going out of my mind, and even getting to the point where im considering reinstalling apache.

Can anyone help!

share|improve this question

2 Answers 2

Any chance you're doing this for the same reason the rest of us are doing this now, custom font files? If so, here's what I wound up doing, might help:

<FilesMatch "\.(ttf|otf|eot)$">
  <IfModule mod_headers.c>
    Header set Access-Control-Allow-Origin "*"
  </IfModule>
</FilesMatch>
share|improve this answer
    
No its for a different purpose, but it applies to font files and any other resource requested from a domain that did not originally serve the initial request. –  James Mar 30 '11 at 15:23

I think the Header directive should go inside a <Directory>, <File> or <Location> section. Like so:

<Directory C:\data>
    Options FollowSymLinks All
    AllowOverride All
    Order deny,allow
    Allow from all
    Header always append Access-Control-Allow-Origin "*"
</Directory>
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.