I need to set the CORS on website build on wordpress, and what I made:
I have added code to .htaccess and functions.php on my template as below. However, I the app with other domain still cannot load the fonts. I have even tested it with CORS tester, and there is information it should work perfectly. But it doesn`t...
The website is build on wordpress 5.3 and Elementor. Fonts are uploaded to Elementor.
I have even used another plugin for custom fonts, added @font-face css... and nothing... The errors about CORS still existing while checking console. Please, could anybody has any ideas how to fix it? I am getting mad about...
Thank you
Added to .htaccess
<FilesMatch ".(eot|otf|ttf|woff|woff2)">
Header always set Access-Control-Allow-Origin "*"
</FilesMatch>
Added to functions.php
function add_cors_http_header(){
header("Access-Control-Allow-Origin: *");
}
add_action('init','add_cors_http_header');
Access-Control-Allow-Method