Solved

How can I add custom font from cPanel/WordPress server?

  • 8 March 2023
  • 6 replies
  • 156 views

Badge +1

Hi Klaviyo’s team/community,

 

Someone know why I can't import my custom font from my Self-Hosted site?

From Shopify servers works fine, but from a cPanel/WordPress/Woocommerce doesn’t it.

I have tested with .woff or .woff2, all the time with all file’s privileges (777) .

 

I can't find info about this issue on your forum.

 

Please, help me.

Thanks in advance.

icon

Best answer by stephen.trumble 9 March 2023, 12:22

View original

6 replies

Badge +3

@cl4udio all working perfectly. Thanks so much. 

That’s one less stressor for today. Thank you!

Badge +1

Hi @fandf ,

 

Just add the following parameters to the .htaccess file:

<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
</IfModule>

Here an example if you’re using WordPress:

 

Official APACHE source: https://enable-cors.org/server_apache.html

 

Tell me if this works well for you... 😎

Badge +3

Hi @stephen.trumble 

After adding the CORS parameter to the “.htaccess” file, it works like a charm! 😎

 

Thank you very much.

 

Hi @cl4udio, how did you find exactly what to add to the .htaccess file from the provided link?
I’m trying to do the same thing at the moment.

Any help would be greatly appreciated.

Userlevel 7
Badge +60

Hey @cl4udio 

I’m so glad you were able to get it solved! Thanks again for being part of the community. Looking forward to seeing you here again!

Badge +1

Hi @stephen.trumble 

After adding the CORS parameter to the “.htaccess” file, it works like a charm! 😎

 

Thank you very much.

Userlevel 7
Badge +60

Hey @cl4udio 

Welcome to the community! Thanks for asking for help with your custom font.

Can you share a little more on what you mean it wont work. Are you getting an error? If so, what error are you getting?

Often times we see an error with the CORS settings. Make sure to enable Cross-Origin Resource Sharing (CORS) by setting the Access-Control-Allow-Origin header to *, so the font can be accessed by your recipients’ inboxes. Learn more about CORS. 

I’ll be in the lookout for your response!

Reply