AWS Lightsail WordPress Headers and Fonts Issue

0

Good day

Will a kind soul please help a desperate novice?

All my WordPress websites are hosted on AWS Lightsail. They all have an issue where the woff2 font icons don't show at times.

I have used the built in SSL Certificate generator on Lightsail. Didn't help. Then I created a distribution with its own SSL certificate. Didn't help. I have used Better Search Replace Plugin in WordPress. Didn't help.

Most advice I got was that I should add code to the .htaccess file. See code below. Didn't help.

<IfModule mod_headers.c>
  <FilesMatch "\.(ttf|ttc|otf|eot|woff|woff2|font.css|css|js)$">
    Header set Access-Control-Allow-Origin "*"
  </FilesMatch>
</IfModule>

<ifmodule mod_headers.c="">
   SetEnvIf Origin "^(.*\.domain\.com)$" ORIGIN_SUB_DOMAIN=$1
   Header set Access-Control-Allow-Origin "%{ORIGIN_SUB_DOMAIN}e" env=ORIGIN_SUB_DOMAIN
   Header set Access-Control-Allow-Methods: "*"
   Header set Access-Control-Allow-Headers: "Origin, X-Requested-With, Content-Type, Accept, Authorization"
</ifmodule>


OR

<FilesMatch "\.(ttf|ttc|otf|eot|woff|woff2|font.css)$">
<IfModule mod_headers.c>
    Header add Access-Control-Allow-Origin "http://mysitename.com"
</IfModule>
</FilesMatch>

All of the above did not work. 🥲

Websites in question: www.bioskoop.co www.groovejet.co www.popcorn-time.co.za www.rickbronkhorst.com www.therainbowmafia.co www.skattedoos.com

I'm just a novice standing in front of the smart guys asking you to help me, please. 😁

profile picture
asked 13 days ago82 views
1 Answer
0

Take a look at the following link. I am not an expert on this but my guess is that they sometimes appear on clients where they happen to be installed (i.e. your workstation/laptop) but they do not appear on clients were they are not installed. This article talks about how you can host the font on your web server and provided it to clients as part of your content.

https://wpengine.com/resources/everything-you-need-to-know-about-web-fonts/#:~:text=All%20you%20have%20to%20do,user%20arrives%20on%20your%20site.

Hopefully this helps!

profile pictureAWS
EXPERT
iBehr
answered 13 days ago
  • Thanks so much. Definitely going to give it a shot. Sounds like a good plan to me.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions