1
我使用谷歌网页速度洞察当时并建议我的CSS的网页是compressed.So我加入这个htaccess的压缩CSS是不能在Firefox和Safari浏览器IPHONE工作
<filesMatch "\.(js|css)$">
Header set Content-Encoding x-deflate
# Header set Content-Encoding compress
# Header set Content-Encoding x-gzip
</filesMatch>
因此它被压缩CSS和工作精细镀铬,但在Firefox当我访问http://fasttorrent.me/cdn/bootstrap.css CSS链接是空白的,我得到以下错误
The character encoding of the plain text document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the file needs to be declared in the transfer protocol or file needs to use a byte order mark as an encoding signature.
所以我添加下面的代码
<filesMatch "\.css$">
FileETag None
<ifModule mod_headers.c>
Header set Content-type "text/css"
</ifModule>
</filesMatch>
但我仍然在firefox和iphone safari中出现同样的错误。
编辑:我试图设置字符集像below..still错误
<filesMatch "\.(html|css|js)$">
AddDefaultCharset UTF-8
DefaultLanguage en-US
Header set Content-Encoding x-deflate
</filesMatch>
错误抱怨字符集,而不是MIME类型。 –
我该如何定义字符集 – Vishnu