Also this right under:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://cloud.mysite.com/assests/uploads/2018/12/why_choose_3.svg. (Reason: CORS header ‘Reason: CORS request did not succeed).[Learn More]
It seems like only .svg files are affected , I have added that path to reject list until I get some solution, added to reject list: {uploads_dir}/2018/12/*.svg
Browser Cache -> HTML/XML ETag and Last Modified are enabled.
Page Cache -> Advanced – Compatibility mode: is disabled.
Hello,
Can you please clarify on what is cloud.mysite.com? Is that your host or someone else’s?
cloud.mysite.com is an example for cloudfrond CDN on how my settings are on ‘Replace site’s hostname with:’ This is the my subdomain set on cloudflare. Everything is working but only svg files.
Hello,
Can you please check if asset on origin produces that header?
‘assets’ folder is actually ‘wp-content’ folder renamed with wp hide plugin. All files withing wp-content/uploads folder works with cloudfront, I only have this problem with svg files.
Hello @alfateam,
Please add the following to your .htaccess file:
<FilesMatch "\.(ttf|otf|eot|woff|svg)$">
<IfModule mod_headers.c>
SetEnvIf Origin "http(s)?://(cdn|sub)\.domain\.com$" AccessControlAllowOrigin=$0
Header add Access-Control-Allow-Origin %{AccessControlAllowOrigin}e env=AccessControlAllowOrigin
Header merge Vary Origin
</IfModule>
</FilesMatch>
still the same error afte htaccess change https://postimg.cc/nCCwCvxK
firefox error :
SEC7120: [CORS] The origin ‘https://mysite.com’ did not find ‘https://mysite.com’ in the Access-Control-Allow-Origin response header for cross-origin resource at ‘https://cloud.mysite.com/assets/uploads/2018/12/why_choose_3.svg’.
chrome error:
Access to XMLHttpRequest at ‘https://cloud.mysite.com/assets/uploads/2018/12/why_choose_1.svg’ from origin ‘https://mysite.com’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.
Hello,
Can you please share your .htaccess file?
Here is it https://pastebin.com/dnaBYbx3 , as stated only *.svg files are affected.
Hello,
Just to confirm, you are using another caching plugin along with the W3 Total Cache?
Yes wprocket but that was installed after the issues with svg file.
Hello,
I do not see the provided rule in your .htaccess file.
It is highly inadvisable to use more than one caching solution. Please remove the other plugin and add the provided rule to your .htaccess file.
Also, make sure there bo WP Rocket rules in .htacess
I removed the rule when I noticed that have no effect.