Javascripts and Access-Control-Allow-Origin
Jun 6, 2016 11:12 am by Willard1975
Jun 6, 2016 11:12 am by Willard1975
Hello
I have the same issue as discussed in this thread. I have added the following to my .htaccess file:
<FilesMatch "\.(ttf|otf|eot|woff|woff2|js)$">
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
</IfModule>
</FilesMatch>
However the Widgetkit slider does not appear when i switch languages. If i temporarily disable the caching on Cloudflare it works in Chrome only. I have tested in all browsers and it's the same in all. You can see the site here and look in the various consoles when switching language.
I don't know what to do anymore.
Regards
Michael
Re: Javascripts and Access-Control-Allow-Origin
Jun 6, 2016 1:30 pm by Yana
Jun 6, 2016 1:30 pm by Yana
Hi,
I can see the following in console
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://travelshop.se/media/widgetkit/widgets/lightbox/js/lightbox.js?wkv=1.4.9?wkv=1.4.9. (Reason: missing token 'x-requested-with' in CORS header 'Access-Control-Allow-Headers' from CORS preflight channel).
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://travelshop.se/media/widgetkit/widgets/slideshow/js/slideshow.js?wkv=1.4.9?wkv=1.4.9. (Reason: missing token 'x-requested-with' in CORS header 'Access-Control-Allow-Headers' from CORS preflight channel).
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://travelshop.se/media/widgetkit/widgets/mediaplayer/mediaelement/mediaelement-and-player.js?wkv=1.4.9?wkv=1.4.9. (Reason: missing token 'x-requested-with' in CORS header 'Access-Control-Allow-Headers' from CORS preflight channel).
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://travelshop.se/media/widgetkit/widgets/spotlight/js/spotlight.js?wkv=1.4.9?wkv=1.4.9. (Reason: missing token 'x-requested-with' in CORS header 'Access-Control-Allow-Headers' from CORS preflight channel).
Please try to add the following instead
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin *
</IfModule>
Re: Javascripts and Access-Control-Allow-Origin
Jun 6, 2016 2:15 pm by Willard1975
Jun 6, 2016 2:15 pm by Willard1975
Hi
I tried that earlier as well but it didn't work. But i added that code back now, purged cloudflare and Joomla cache. It's not working here as far as i can see. Is it working for you?
/Michael
Re: Javascripts and Access-Control-Allow-Origin
Jun 6, 2016 3:39 pm by Yana
Jun 6, 2016 3:39 pm by Yana
Hi,
It works only with Google Chrome.
Please check the following post
widgetkit-and-gtranslate-problem-t4317.html#:~:text=widgetkit
Re: Javascripts and Access-Control-Allow-Origin
Jun 7, 2016 7:13 am by Willard1975
Jun 7, 2016 7:13 am by Willard1975
If you look at my original post i have read that thread already.
Is there a way to switch from sub-domains to sub-directory easily? If i change it now everything results in a 404 error. Also will Google still index the site in different countries if i switch?
Re: Javascripts and Access-Control-Allow-Origin
Jun 7, 2016 9:29 am by Willard1975
Jun 7, 2016 9:29 am by Willard1975
Never mind i solved it. The following was needed in .htaccess:
<FilesMatch "\.(ttf|otf|eot|woff|woff2|js)$">
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
Header set Access-Control-Allow-Headers "Accept, X-Requested-With"
</IfModule>
</FilesMatch>
/Michael
Re: Javascripts and Access-Control-Allow-Origin
Jun 7, 2016 1:29 pm by Yana
Jun 7, 2016 1:29 pm by Yana
Hi,
Thanks for sharing your experience!
SIMILAR TOPICS
Forbidden You don't have permission to access /wp-admin/opti | Dec 8, 2018 4:26 pm | Replies: 1 | Post by: seanyeom |
Intermittent 403 Errors (Forbidden: Access is denied) | Sep 28, 2018 2:07 pm | Replies: 3 | Post by: mattbradley85 |
403: Access Forbidden | Oct 23, 2017 6:35 am | Replies: 7 | Post by: avkeele |
Google robot can't access the website | Jun 3, 2015 10:02 am | Replies: 3 | Post by: jota |
translates partially on the first access | May 11, 2015 2:21 pm | Replies: 3 | Post by: shopandtravelguides |