fausto94 Posted May 11, 2017 Report Share Posted May 11, 2017 Hello, I'm trying to perform CORS requests but everytime I try I face this error: Cannot load "services provider site". Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'my domain' is therefore not allowed access. I tried modifying the js code of my site, I tried modifying the .htacces but nothing. I entered the Access-Control-Allow-Origin in many different ways. Is there a way to modify the server settings and configure the requests header? How can I modfy my requests' header? Thank you very much for your help Quote Link to comment Share on other sites More sharing options...
Tony Posted May 12, 2017 Report Share Posted May 12, 2017 Hello, I can't make any guarantees on this but maybe this will put you in the right direction. We utilize Litespeed and I've seen a few ways thrown around on how to do this: <FilesMatch "\.(gif|png|jpe?g|svg|svgz|ico|webp)$"> SetEnvIf Origin ":" IS_CORS Header set Access-Control-Allow-Origin "*" env=IS_CORS </FilesMatch> <FilesMatch "\.(ttf|ttc|otf|eot|woff|font.css|css|woff2)$"> Header set Access-Control-Allow-Origin "*" </FilesMatch> So in this case they're doing it for specific types. There is also a discussion on the Litespeed forums on other ways to accomplish this: https://www.litespeedtech.com/support/forum/threads/header-set-access-control-allow-origin.8346/ Quote Link to comment Share on other sites More sharing options...
fausto94 Posted May 14, 2017 Author Report Share Posted May 14, 2017 On 12/5/2017 at 8:46 PM, Tony said: <FilesMatch "\.(gif|png|jpe?g|svg|svgz|ico|webp)$"> SetEnvIf Origin ":" IS_CORS Header set Access-Control-Allow-Origin "*" env=IS_CORS </FilesMatch> <FilesMatch "\.(ttf|ttc|otf|eot|woff|font.css|css|woff2)$"> Header set Access-Control-Allow-Origin "*" </FilesMatch> tried adding js but nothing.. Thank you for trying, I'll check something else for Litespeed Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.