handle multiple domains with Access-Control-Allow-Origin header in Apache

后端 未结 8 939
独厮守ぢ
独厮守ぢ 2020-12-08 10:17

I want to configure apache for cross-domain access header. I have tried multiple combination as suggested on number of threads on the forum. But its not working for me.

8条回答
  •  心在旅途
    2020-12-08 10:23

    Try this one, it works for me. Apply in .htaccess:

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

提交回复
热议问题