Skip to content

Instantly share code, notes, and snippets.

@fabricekabongo
Created December 12, 2015 16:48
Show Gist options
  • Save fabricekabongo/6bbd9facb1b3f2771b47 to your computer and use it in GitHub Desktop.
Save fabricekabongo/6bbd9facb1b3f2771b47 to your computer and use it in GitHub Desktop.
How to avoid cross errors
Header always set Access-Control-Allow-Origin "*"
Header always set Access-Control-Allow-Methods "POST, GET, OPTIONS, DELETE, PUT"
Header always set Access-Control-Max-Age "15552000"
Header always set Access-Control-Allow-Headers "x-requested-with, Content-Type, origin, authorization, accept, client-security-token"
# and after RewriteEngine On
RewriteCond %{REQUEST_METHOD} OPTIONS
RewriteRule ^(.*)$ $1 [R=200,L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment