How to activate web fonts for a domain?

Created:

2017-08-06 05:07:54 UTC

Modified:

2017-08-16 17:17:10 UTC

0

Was this article helpful?


Have more questions?

Submit a request

How to activate web fonts for a domain?

Applicable to:

  • Plesk for Linux

Question

How to activate web fonts for a domain?

Answer

This functionality is not related to Plesk. Instructions below is just general information that may help with activating webfonts, but it is not supported by Plesk:

For Apache:

1. Create an .htaccess file in the root folder of the domain (for example, in the /var/www/vhosts/example.com/httpdocs/ ); 2. Add the following lines in the .htaccess :

AddType application/x-font-ttf           ttc ttf
AddType application/x-font-otf           otf
AddType application/font-woff            woff
AddType application/font-woff2           woff2
AddType application/vnd.ms-fontobject    eot

3. In the Domains > example.com > Apache & nginx Settings > Additional directives for HTTP(s) add the following:

<FilesMatch ".(eot|ttf|otf|woff|woff2)">
Header set Access-Control-Allow-Origin "*"
</FilesMatch>

4. Use the service httpd reload command to reload Apache configuration.

For nginx:

1. Add (or modify) the following lines in the /etc/nginx/mime.types :

application/x-font-ttf           ttc ttf;
application/x-font-otf           otf;
application/font-woff            woff;
application/font-woff2           woff2;
application/vnd.ms-fontobject    eot;

2. In the Domains > example.com > Apache & nginx Settings > Additional nginx directives add the following:

location ~* \.(eot|otf|ttf|woff|woff2)$ {
    add_header Access-Control-Allow-Origin *;
}

3. Use the service nginx reload command to reload nginx configuration.

Have more questions? Submit a request
Please sign in to leave a comment.