diff --git a/www-api/public/.htaccess b/www-api/public/.htaccess index a5d6c2a5..83ffbc6f 100644 --- a/www-api/public/.htaccess +++ b/www-api/public/.htaccess @@ -26,6 +26,14 @@ Options All -Indexes RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L] + #Redirect for CORS Preflight request + RewriteCond %{REQUEST_METHOD} OPTIONS + RewriteRule ^(.*)$ $1 [R=200,L] + #Set headers to access CORS Requests / allowing localhost only + Header always add Access-Control-Allow-Origin "*" + Header always add Access-Control-Allow-Headers "origin, x-requested-with, content-type" + Header always add Access-Control-Allow-Methods "PUT, GET, POST, DELETE, OPTIONS" + # Checks to see if the user is attempting to access a valid file, # such as an image or css document, if this isn't true it sends the # request to the front controller, index.php