Created
July 8, 2016 17:53
-
-
Save therealkevinard/f22bb164d4e4e820d934703cf802fab6 to your computer and use it in GitHub Desktop.
htaccess tricks: CORS list. allows a list of domains to allow resource-sharing. Domain list is by way of regex OR syntax.
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
# CORS list | |
<IfModule mod_headers.c> | |
SetEnvIf Origin "http(s)?://(www\.)?(domainone\.com|domaintwo\.com)$" AccessControlAllowOrigin=$0 | |
Header add Access-Control-Allow-Origin %{AccessControlAllowOrigin}e env=AccessControlAllowOrigin | |
</IfModule> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment