这可能真的很简单,但是我的编码器正在休假中,并且没有通信,而且我是一位具有相当基本的HTML和CSS知识的图形设计师。这超出了我。
我们的客户站点之一正在解决此问题:
.htaccess:FilterProvider采用三个参数,filter-name
提供者名称匹配表达式
我认为它与.htaccess文件的这一部分有关,但是如果我知道答案是什么,我该死的:
#强制对变形的标头放气
developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping/
SetEnvIfNoCase ^(Accept-EncodXng | X-cept-Encoding | X {15} |〜{15} |-{15})$
^((gzip | deflate)\ s *,?\ s *)+ | [X〜-] {4,13} $ HAVE_Accept-Encoding
RequestHeader追加接受编码“ gzip,deflate” env = HAVE_Accept-Encoding
#HTML,TXT,CSS,JavaScript,JSON,XML,HTC:
过滤器声明COMPRESS
FilterProvider COMPRESS DEFLATE resp =内容类型$ text / html
FilterProvider COMPRESS DEFLATE resp =内容类型$ text / css
FilterProvider COMPRESS DEFLATE resp =内容类型$ text / plain
FilterProvider COMPRESS DEFLATE resp =内容类型$ text / xml
FilterProvider COMPRESS DEFLATE resp =内容类型$ text / x-component
FilterProvider COMPRESS DEFLATE resp =内容类型$ application / javascript
FilterProvider COMPRESS DEFLATE resp =内容类型$ application / json
FilterProvider COMPRESS DEFLATE resp =内容类型$ application / xml
FilterProvider COMPRESS DEFLATE resp =内容类型$ application / xhtml + xml
FilterProvider COMPRESS DEFLATE resp =内容类型$ application / rss + xml
FilterProvider COMPRESS DEFLATE resp =内容类型$ application / atom + xml
FilterProvider COMPRESS DEFLATE resp =内容类型$ application / vnd.ms-fontobject
FilterProvider COMPRESS DEFLATE resp =内容类型$ image / svg + xml
FilterProvider COMPRESS DEFLATE resp =内容类型$ image / x-icon
FilterProvider COMPRESS DEFLATE resp =内容类型$ application / x-font-ttf
FilterProvider COMPRESS DEFLATE resp =内容类型$ font / opentype
FilterChain COMPRESS
FilterProtocol COMPRESS DEFLATE change =是;字节范围=否
#Apache的旧版本
AddOutputFilterByType DEFLATE text / html text / plain text / css application / json
AddOutputFilterByType DEFLATE应用程序/ javascript
AddOutputFilterByType DEFLATE文本/ xml应用程序/ xml文本/ x-component
AddOutputFilterByType DEFLATE应用程序/ xhtml + xml应用程序/ rss + xml应用程序/ atom + xml
AddOutputFilterByType DEFLATE image / x-icon image / svg + xml application / vnd.ms-fontobject application / x-font-ttf font / opentype
如果有人可以帮忙,我将万分感谢!
最佳答案
更换
FilterDeclare COMPRESS
...
...
...
FilterChain COMPRESS
FilterProtocol COMPRESS DEFLATE change=yes;byteranges=no
与
FilterDeclare COMPRESS
FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'text/html'"
FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'text/css'"
FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'text/plain'"
FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'text/xml'"
FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'text/x-component'"
FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'application/javascript'"
FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'application/json'"
FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'application/xml'"
FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'application/xhtml+xml'"
FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'application/rss+xml'"
FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'application/atom+xml'"
FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'application/vnd.ms-fontobject'"
FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'image/svg+xml'"
FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'image/x-icon'"
FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'application/x-font-ttf'"
FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'font/opentype'"
FilterChain COMPRESS
FilterProtocol COMPRESS DEFLATE change=yes;byteranges=no
关于javascript - .htaccess:FilterProvider问题,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/31512745/