Created
December 24, 2013 11:44
-
-
Save abulte/8112145 to your computer and use it in GitHub Desktop.
WordPress AngularJS CORS setup
This file contains hidden or 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 Headers (add this) | |
<ifModule mod_headers.c> | |
Header always set Access-Control-Allow-Origin: "*" | |
Header always set Access-Control-Allow-Methods "POST, GET, PUT, DELETE, OPTIONS" | |
Header always set Access-Control-Allow-Headers "X-Requested-With, content-type" | |
</ifModule> | |
# BEGIN WordPress (you should have this in your original WP .htaccess) | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / | |
# CORS OPTIONS (add this too) | |
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