Skip to content

Instantly share code, notes, and snippets.

@esedic
Created November 20, 2014 12:22
Show Gist options
  • Save esedic/747d1b33d64d5cb64f73 to your computer and use it in GitHub Desktop.
Save esedic/747d1b33d64d5cb64f73 to your computer and use it in GitHub Desktop.
Cross-Origin Resource Sharing policy override with .htaccess
## Situation: you want to load web font or other asset from subdomain
# Because of the cross origin access policy, you get an error
# Put this is in .htaccess file inside your root folder and this limitation will be gone
##
Header add Access-Control-Allow-Origin "*"
Header add Access-Control-Allow-Headers "origin, x-requested-with, content-type"
Header add Access-Control-Allow-Methods "PUT, GET, POST, DELETE, OPTIONS"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment