Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ForceType text/html;charset=utf-8 in .htaccess is causing all externally linked CSS to stop rendering

I'm using:

ForceType text/html;charset=utf-8

in my .htaccess file, but it's causing all externally linked CSS to stop rendering on their respective pages.

So something like this:

<link rel="stylesheet" type="text/css" href="somestyles.css" media="all" />

no longer works on the page using it.

I've also been trying combinations of:

AddCharset utf-8 .html
AddCharset utf-8 .htm
AddCharset utf-8 .css
AddCharset utf-8 .js
ForceType text/html;charset=utf-8
ForceType text/css;charset=utf-8

but no luck so far. Does anyone know what's wrong?

like image 494
chimerical Avatar asked Oct 17 '25 20:10

chimerical


1 Answers

This is all you need to get UTF-8 for both CSS and Javascript files:

AddDefaultCharset utf-8
AddCharset utf-8 .css .js
like image 141
August Karlstrom Avatar answered Oct 21 '25 07:10

August Karlstrom