CORS policy blocking my pictures

Question

I have a problem enabling CORS on my WordPress website, hosted by WordPress.
There’s a fuction which generates and allow to download a PDF file made of text and pictures on the same web page.

Those pictures are uploaded first on the page, using the media library but are located on WordPress cloud I think, because when I create and download my pdf, there is a CORS error which blocks my pictures only :

Chrome console displaying errors

I tried to create and edit an .htaccess file and allow cross origin, but it is not working. Also, I don’t think it is in the right place (I uploaded in htdocs using FTP. Not in root folder as I don’t have permissions) :

.htaccess file localisation

My .htaccess file contains this :

<FilesMatch ".(?i:gif|jpe?g|png)$">
Require all granted
Header set Access-Control-Allow-Origin "*"
</FilesMatch>

But still not working.

0
Dcwp 4 months 0 Answers 17 views 0

Leave an answer