Link to home
Start Free TrialLog in
Avatar of Paul Konstanski
Paul KonstanskiFlag for United States of America

asked on

Setting Up Cross Browser Support for Multiple Domains in .htaccess

I am running a number of api scripts off of a single server. A number of outside sites access these scripts from different domains.

When I use this command, it works fine.

Header add Access-Control-Allow-Origin "http://example1.com"

My online research told me that this was the way to set up the .htaccess file for multiple domains, but it isn't working.

SetEnvIf Origin "^http(s)?://(.+\.)?(example1\.com|example2\.com | example3\.org)$" origin_is=$0
Header always set Access-Control-Allow-Origin %{origin_is}e env=origin_is


Can you provide assistance as to how this .htaccess file needs to be set up to provide cross browswer support?

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of Paul Konstanski
Paul Konstanski
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial