CORS Policy

bcx

Verified User
Joined
Dec 11, 2015
Messages
77
Hi there.
I have issues with the CORS Policy, and not sure if this is server related.

I'm running wordpress on my server
I made a subdomain for all media files so new uploads will load from a subdomain (wp-admin/options.php)

Upload _path = cdn/v
upload_url_path = https://cdn.mydomain.com/v

Everything went smoothly, but suddenly weeks later custom fonts or new custom fonts are not working anymore.
Access to font at 'https://cdn.mydomain.com/.../roboto--v30-normal-700.woff2...' from origin 'https://www.mydomain.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

On the subdomain i made a .htaccess file in it, but still doesn't work? What do I forget? Or do i need to change something in directadmin, that maybe has been changed since the last update?


Code:
# BEGIN CORS
<IfModule mod_headers.c>
<FilesMatch ".(ttf|ttc|otf|eot|woff|woff2|font.css|css|js)">
Header set Access-Control-Allow-Origin "*"
</FilesMatch>
</IfModule># END CORS
 
let checking from web server.

Currently do you use APACHE or OPENLITESPEED ?
 
OLS doesn't support all the rest apache directives at all., it only support rewrite rule.
 
OLS only support rewrite rules. If you want to use that .htaccess config, you have 2 choice.

First: go back to apache.
Second: use Litespeed.
 
That's not an option, it worked in the past. Directadmin receives a lot of updates @smtalk are you able to assist me, please?
 
Back
Top