Skip to content

Instantly share code, notes, and snippets.

@therealkevinard
Created July 8, 2016 17:53
Show Gist options
  • Save therealkevinard/f22bb164d4e4e820d934703cf802fab6 to your computer and use it in GitHub Desktop.
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.
# 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