HomePage › Forums › Themes Support › Triply – Tour Booking WordPress Theme › Access-Control-Allow-Origin issue
- This topic has 5 replies, 2 voices, and was last updated 11 months, 2 weeks ago by Billy Nguyen.
-
AuthorPosts
-
May 11, 2023 at 4:33 pm #34552milapolovnevaSupport Expired
Hello.
A few weeks ago, we launched a new website built on your theme, Triply Child, and almost immediately encountered some mobile usability issues.
It looks like crawlers have trouble accessing page resources as zero can be loaded, and the Java Script Console Message complains that access to the fonts we use has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.”
After the first time it popped up, we added the following code to the .htaccess file to solve the issue.
# Apache config
<FilesMatch “.(eot|ttf|otf|woff)”>
Header set Access-Control-Allow-Origin “*”
</FilesMatch>The solution worked, the website showed no mobile usability problems for a few days, and then the issue came back. Can you please advise on how we can solve the Access-Control-Allow-Origin error?
Have a great day.
May 12, 2023 at 11:22 am #34580I have installed SSL fix plugin to solve your problem, please check again.
You can also refer to the solution to this problem here: https://crunchify.com/how-to-fix-access-control-allow-origin-issue-for-your-https-enabled-wordpress-site-and-maxcdn/May 12, 2023 at 7:07 pm #34598milapolovnevaSupport ExpiredHello.
Thank you very much for working on my problem.
The live test of the home page in GSC shows that some page resources were loaded successfully (in contrast to none we had before), but the Java Script error is still on the table. As you can see in the screenshot https://prnt.sc/9tDM4QxMB3d8 we have the same error with the fonts that can’t be loaded due to the CORS policy.
Can you please advise on what else can be done regarding the Access-Control-Allow-Origin error?
Best of luck,
May 15, 2023 at 11:00 am #34624Hi,
The screenshot shows that you are using the CDN service, which caused this Access-Control-Allow-Origin error.
Please refer to the tutorial link I sent earlier or contact the server support for assistance with this issue.May 18, 2023 at 4:40 pm #34753milapolovnevaSupport ExpiredThank you for the manual you kindly provided. I changed the original URL from “http” to “https” and added the following code to our.htaccess file to address the font issue specifically:
<IfModule mod_headers.c>
<FilesMatch “\.(ttf|ttc|otf|eot|woff|woff2|font.css|css|js)$”>
Header set Access-Control-Allow-Origin “*”
</FilesMatch>
</IfModule>However, it seems we are back to square one, as the CORS issue is still there and no resources can be loaded when testing live URL in GSC. What else can we try?
May 19, 2023 at 10:47 am #34785As mentioned above, the problem is caused by your CDN installation, so please contact CDN service support for guidance and assistance in this matter.
-
AuthorPosts
You must be logged in to reply to this topic.