Skip to content

Instantly share code, notes, and snippets.

@greenpeas
Created March 11, 2020 08:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save greenpeas/73a58228f6ae24000293df8962437ec7 to your computer and use it in GitHub Desktop.
Save greenpeas/73a58228f6ae24000293df8962437ec7 to your computer and use it in GitHub Desktop.
Apache .htaccess CORS
RewriteEngine On
Header always add Access-Control-Allow-Origin "*"
Header always add Access-Control-Allow-Headers "*"
RewriteCond %{REQUEST_METHOD} OPTIONS
RewriteRule ^(.*)$ $1 [R=200,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [QSA,L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment