google font

  • graeme
    Active member
  • Topic Author
  • Member
  • Member
More
1 week 5 days ago #51976 by graeme
Replied by graeme on topic google font
Hi Milos, I have not resolved the font issue yet. I did receive the below from my host:
Thank you for your email.

​CSS files are generally allowed to be served without restrictions, whereas fonts can be a source of vulnerability and thus should be allowed selectively.

This generally requires that you grant access to fonts being loaded externally via the .htaccess files rule-set, take the below as an example:
AddType application/font-woff2 .woff2
AddType application/font-woff .woff
AddType application/x-font-ttf .ttf
AddType application/vnd.ms-fontobject .eot
AddType font/opentype .otf

If there are subdomain involved, you should include the below for cross origin requests (CORS):
<FilesMatch "\.(ttf|ttc|otf|eot|woff|woff2|svg)$">
Header set Access-Control-Allow-Origin "*"
</FilesMatch>

And very importantly, confirm that there is not a .htaccess file present in the /media/templates/site/academy/fonts/ folder that restricts access to these font files. For further support, your web developer may be able to advise you best on how to fine-tune these configurations.

Please Log in to join the conversation.

  • milos
    Support Staff
  • Moderator
  • Moderator
More
1 week 4 days ago - 1 week 4 days ago #51977 by milos
Replied by milos on topic google font
Hello,

So, your host confirms that they are not allowing the downloading of fonts by default. However, this can be overridden by adding the code they gave you to the .htaccess file that you can find in the Joomla root. So, open this file with a plain text editor (such as Notepad (Windows) or TextEdit (Mac) and add the lines they gave you:
Code:
AddType application/font-woff2 .woff2 AddType application/font-woff .woff AddType application/x-font-ttf .ttf AddType application/vnd.ms-fontobject .eot AddType font/opentype .otf

If there's no .htaccess file in the root folder of your Joomla, you can create a new file in Notepad (Windows) or TextEdit (Mac), add these commands, and upload it to the root Joomla folder.

Also, you can use the method I explained in my previous message to include Google fonts directly from Google's server, without downloading to your host.

Regards,
Milos
Last edit: 1 week 4 days ago by milos.

Please Log in to join the conversation.

  • graeme
    Active member
  • Topic Author
  • Member
  • Member
More
1 week 4 days ago #51978 by graeme
Replied by graeme on topic google font
I dont know much about .htaccess files, I do know they are not meant to be blank, mine was blank when I downloaded it, Are you able to help out with a correct .htaccess file?

Please Log in to join the conversation.

  • milos
    Support Staff
  • Moderator
  • Moderator
More
1 week 3 days ago #51979 by milos
Replied by milos on topic google font
Hello,

This file is a simple textual file, just named .htaccess

Try the file from the attachment. This is the default Joomla .htaccess file, and I added the few lines recommended by your host. Unzip it on your computer and then upload it to the root Joomla folder using FTP.

If your site doesn't work as expected after uploading the file, consult your web hosting provider.

If your site works normally, remove the fonts you have added in the template settings and try adding them again.

Regards,
Milos

 

File Attachment:

File Name: htaccess.zip
File Size:3 KB

Please Log in to join the conversation.

Time to create page: 0.162 seconds
Powered by Kunena Forum