How to set a Access-Control-Allow-Origin with Yola?

  • 1
  • Question
  • Updated 5 years ago
  • Answered
Hello,

Having problem with Font-awesome icons not to appear in Firefox. Found the best solution to get out of that, is to set a Access-Control-Allow-Origin header to the font.
I don't know where to add the following codes
For .htaccess


Header set Access-Control-Allow-Origin "*"



For nginx
location ~* location ~* \.(eot|otf|ttf|woff)$ {

add_header Access-Control-Allow-Origin *;
}
#46;(eot|otf|ttf|woff)$ {
add_header Access-Control-Allow-Origin *;
}

Here is my site.
Help please! REFERENCE
Photo of Neno

Neno

  • 5 Posts
  • 0 Reply Likes
  • frustrated

Posted 5 years ago

  • 1
Photo of Gop

Gop

  • 7473 Posts
  • 2115 Reply Likes
Hello Neno,

We don't have access to the server at all, including .htaccess.

The solutions you have researched for this can't work unfortunately. Any control must be effective from the site markup so you are looking at HTML and js as the only possible control of these needs.
Photo of Neno

Neno

  • 5 Posts
  • 0 Reply Likes
Hello,

Having problem with Font-awesome icons not to appear in Firefox. Found the best solution to get out of that, is to set a Access-Control-Allow-Origin header to the font.
I don't know where to add the following codes
For .htaccess


<FilesMatch "
<FilesMatch "\.(ttf|otf|woff)$">
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
</IfModule>
</FilesMatch>
#46;(ttf|otf|woff)$">
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
</IfModule>
</FilesMatch>


For. nginx


location ~*
location ~* \.(eot|otf|ttf|woff)$ {
add_header Access-Control-Allow-Origin *;
}
#46;(eot|otf|ttf|woff)$ {
add_header Access-Control-Allow-Origin *;
}
Photo of Neno

Neno

  • 5 Posts
  • 0 Reply Likes
Hello Gop,

Thanks for responding. Until this point I feel confused, I do not know what to do, where to start and where to end up.

Thanks.
Photo of Gop

Gop

  • 7473 Posts
  • 2115 Reply Likes
Hello Neno,

I wish I was familiar with Font-Awesome and to be able to offer some support. Can you give me a brief explanation of what Font-Awesome offers in relation to your needs. I've used a couple of Font implementations with Yola sites and now of course an increased in-house library of various fonts

I'm lurching on this one and am really not sure if I'm even in the ball park in relation to your broader vision. Happy to offer as much support as I can(?)
Photo of Neno

Neno

  • 5 Posts
  • 0 Reply Likes
Hello Gop,

Thanks again for responding.Please visit my website you can see that I use font-awesome social icons, and more. If you use Chrome and IE browsers font-awesome icons appears, bug is if you use Firefox, fonts-awesome icons do not appear. The problem here is that, Firefox do not allow using a font by default that is not hosted on my domain (I do not know how to fix with Yola). Also I do not know where I'm wrong, I'll be happy if you give me guidance and support in this, I am stuck.
Thanks.
Photo of Gop

Gop

  • 7473 Posts
  • 2115 Reply Likes
Neno,

I have had a scan through various FAQ's and so re this issue, eg: Git-Hub & Stack Overflow and as you say it's a known effect. Unfortunately I cannot see another solution that would allow a Yola user to overcome this.

I suspect that the only solution would be a server addition and this would need to be done by the Yola developers and engineers.

This is one for the Yola people and I'm sure that Stephan and Laura, the forum moderators, will pick up on this and see what the way forward may be.
Photo of Stefan

Stefan, Official Rep

  • 4448 Posts
  • 190 Reply Likes
Hello Neno

Unfortunately, for security reasons, we cannot allow our users to edit their htaccess files. We take this precaution to protect your site from other users who may use their htaccess file for malicious purposes. At present there is no way to ban a particular IP address from your site. I'm sorry I don't have a better answer for you on this matter right now.
Photo of Neno

Neno

  • 5 Posts
  • 0 Reply Likes
@Stefan,

I regret.