I\'m working with an apache server, and I\'d like to add headers conditionally.
If the URI matches a certain regex, I\'d like to add the header Access-Control-
This should also work (mod_rewrite is required):
RewriteRule ^/en/foo.*$ - [ENV=SET_ACAO:true]
Header set "Access-Control-Allow-Origin" "*" env=SET_ACAO
where ^/en/foo.*$
a regex which is matched against request URL
SetEnvIf Request_URI somepartofurl SIGN
Header always add "Access-Control-Allow-Origin" "*" env=SIGN
but this works only if located in the configuration. Placing it into .htaccess won't help.