.htaccess:FilterProvider问题

时间:2015-07-20 09:14:53

标签: javascript json .htaccess

这可能非常简单,但是我的程序员正在度假并且没有通讯,我是一名具有相当基本的HTML和CSS知识的平面设计师。这超出了我的范围。

我们的一个客户网站正在解决此问题:

  

.htaccess:FilterProvider有三个参数,filter-name   provider-name match-expression

我认为它与.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附加Accept-Encoding“gzip,deflate”env = HAVE_Accept-Encoding          
  
    #HTML,TXT,CSS,JavaScript,JSON,XML,HTC:
      FilterDeclare COMPRESS
      FilterProvider COMPRESS DEFLATE resp = Content-Type $ text / html
      FilterProvider COMPRESS DEFLATE resp = Content-Type $ text / css
      FilterProvider COMPRESS DEFLATE resp = Content-Type $ text / plain
      FilterProvider COMPRESS DEFLATE resp = Content-Type $ text / xml
      FilterProvider COMPRESS DEFLATE resp = Content-Type $ text / x-component
      FilterProvider COMPRESS DEFLATE resp = Content-Type $ application / javascript
      FilterProvider COMPRESS DEFLATE resp = Content-Type $ application / json
      FilterProvider COMPRESS DEFLATE resp = Content-Type $ application / xml
      FilterProvider COMPRESS DEFLATE resp = Content-Type $ application / xhtml + xml
      FilterProvider COMPRESS DEFLATE resp = Content-Type $ application / rss + xml
      FilterProvider COMPRESS DEFLATE resp = Content-Type $ application / atom + xml
      FilterProvider COMPRESS DEFLATE resp = Content-Type $ application / vnd.ms-fontobject
      FilterProvider COMPRESS DEFLATE resp = Content-Type $ image / svg + xml
      FilterProvider COMPRESS DEFLATE resp = Content-Type $ image / x-icon
      FilterProvider COMPRESS DEFLATE resp = Content-Type $ application / x-font-ttf
      FilterProvider COMPRESS DEFLATE resp = Content-Type $ font / opentype
      FilterChain COMPRESS
      FilterProtocol COMPRESS DEFLATE change = yes; byteranges = no
  
    
      #Phapacy版本的Apache       AddOutputFilterByType DEFLATE text / html text / plain text / css application / json
      AddOutputFilterByType DEFLATE application / javascript
      AddOutputFilterByType DEFLATE text / xml application / xml text / x-component
      AddOutputFilterByType DEFLATE application / xhtml + xml application / rss + xml application / atom + xml
      AddOutputFilterByType DEFLATE image / x-icon image / svg + xml application / vnd.ms-fontobject application / x-font-ttf font / opentype

  
  
  

如果有人可以提供帮助,我将非常感激!

1 个答案:

答案 0 :(得分:5)

替换

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