CORS configuration with HTTPS redirection problem
Hello There,
My Webserver has blocked an API in my website due to CORS policy that causes serious problems in loading website content.
I got this error:
" Access to XMLHttpRequest from origin has been blocked by cors policy
response to preflight request doesn't pass access control check" redirect is not allowed for a preflight request."
con someone help me please configure my .Htacess file?
Options -MultiViews -Indexes
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteCond %{HTTP_HOST} ^(www\.)?eagle-elearn\.com
RewriteRule ^(.*)$ https://www.eagle-elearn/$1 [R,L]
Header set Access-Control-Allow-Origin "*"
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
Header always append X-Frame-Options SAMEORIGIN
Please sign in to leave a comment.
Comments
0 comments