I want to configure apache to allow XMLHttpRequests from multiple, but not all domains.
This works:
Header set Access-Control-Allow-Origin \"*\"
<
you can use SetEnvIf in your .htaccess file or in in vhost file (inside "Directory" group):
SetEnvIfNoCase Origin "https?://(www\.)?(mydomain\.com|mydomain2\.com)(:\d+)?$" AccessControlAllowOrigin=$0
Header set Access-Control-Allow-Origin %{AccessControlAllowOrigin}e env=AccessControlAllowOrigin
With this code you can allow access from
You can add multiple domains separated with | or you can use regexp to configure different subdomains or patterns.