Created
June 3, 2015 14:14
-
-
Save johanbove/6cd72c343665a5a3e97c to your computer and use it in GitHub Desktop.
htaccess commands to set "Access-Control-Allow-Origin"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Header add Access-Control-Allow-Origin "http://domain.com" | |
#Header add Access-Control-Allow-Headers "origin, x-requested-with, content-type" | |
#Header add Access-Control-Allow-Methods "GET, POST, DELETE, OPTIONS" | |
#Header add Access-Control-Allow-Methods "GET, POST" | |
SetEnvIf Origin "^http(s)?://(.+\.)?(domain\.org|domain2\.com)$" origin_is=$0 | |
Header always set Access-Control-Allow-Origin %{origin_is}e env=origin_is |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment