Home > Blockchain >  woff2 file can't be accessed on apache webserver
woff2 file can't be accessed on apache webserver

Time:07-28

I'm trying to reach (download or load) a woff2 file on an apache server using hestiacp and I have a 500 error.

In the same folder if I put a ttf file when I reach it it downloads it normally. I tried to manage it with a .htaccess file adding

AddType font/woff2 .woff2

and then even restarting apache it won't work.

I also tried adding this type on my apache configuration file.

CodePudding user response:

AH00681: Syntax error in type map, no ':' in /home/admin/web/*.com/public_html/font/Inter-roman.var.woff2 for header wof2

The server thinks your woff2 file was actually a type map - but since it doesn't find any : in there, it doesn't consider it to be a valid type map file.

The reason / connection to content negotiation, is that the default configuration for that typically includes

AddHandler type-map .var

(https://httpd.apache.org/docs/2.4/content-negotiation.html#negotiation)

And as https://httpd.apache.org/docs/2.4/mod/mod_mime.html#addtype says,

Filenames may have multiple extensions and the extension argument will be compared against each of them.

This behavior is not configurable as far as I know, this is hard-coded functionality.

  • Related