Last active
August 29, 2015 14:24
-
-
Save awojtczyk/c844bffe6bb399168cc7 to your computer and use it in GitHub Desktop.
CORS configuration with AngularJS and WordPress
This file contains 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