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
질문됨 한 달 전98회 조회
1개 답변
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
전문가
iBehr
답변함 한 달 전
  • Thanks so much. Definitely going to give it a shot. Sounds like a good plan to me.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠