Php Apache Access Control Allow Origin Multiple Origin Domains

Paylaş.

<IfModule mod_rewrite.c>
<IfModule mod_headers.c>

# Define the root domain that is allowed
SetEnvIf Origin .+ ACCESS_CONTROL_ROOT=karadere.com

# Check that the Origin: matches the defined root domain and capture it in
# an environment var if it does
RewriteEngine On
RewriteCond %{ENV:ACCESS_CONTROL_ROOT} !=””
RewriteCond %{ENV:ACCESS_CONTROL_ORIGIN} =””
RewriteCond %{ENV:ACCESS_CONTROL_ROOT}&%{HTTP:Origin} ^([^&]+)&(https?://(?:.+?\.)?\1(?::\d{1,5})?)$
RewriteRule .* – [E=ACCESS_CONTROL_ORIGIN:%2]

# Set the response header to the captured value if there was a match
Header set Access-Control-Allow-Origin %{ACCESS_CONTROL_ORIGIN}e env=ACCESS_CONTROL_ORIGIN Header set Access-Control-Allow-Origin “*”
</IfModule>
</IfModule>

 

 

veya

<IfModule mod_rewrite.c>
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin “*”
</IfModule>
</IfModule>

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)