.htaccess lighttpd font-face

herewith how you can enable .htaccess for lighttpd to solve issue @font-face in mozilla firefox

issue :

I am serving truetype (ttf) fonts as font/truetype and opentype (otf) as font/opentype, but I cannot find the correct format for WOFF fonts.

I have tried font/woff, font/webopen, and font/webopentype, but Chrome still complains:

“Resource interpreted as font but transferred with MIME type application/octet-stream.”

Anybody know?


for apache and nginx

http://stackoverflow.com/questions/3594823/mime-type-for-woff-fonts

for lighttpd

#vim /etc/lighttpd/lighttpd.conf

add this line

$HTTP["url"] =~ "\.(ttf|otf|eot|woff)$" {
setenv.add-response-header = ( "Access-Control-Allow-Origin" => "*" )
}

save it and restart your lighttpd, should be done,

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s