Wordpress 我能';t使用此代码在.htaccess中启用gzip。我还需要做什么?

Wordpress 我能';t使用此代码在.htaccess中启用gzip。我还需要做什么?,wordpress,.htaccess,google-pagespeed,Wordpress,.htaccess,Google Pagespeed,我试图用gzip压缩,所以我把这个块放在了.htaccess文件中 # BEGIN Gzip <ifmodule mod_deflate.c> AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript </ifmodule> # END Gzip #开始Gzip AddOutp

我试图用gzip压缩,所以我把这个块放在了.htaccess文件中

# BEGIN Gzip
<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
</ifmodule>
# END Gzip
#开始Gzip
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
#结束Gzip
我仍然在Google PageSpeed中收到“启用压缩”消息;然而,在上,它说我的网站是gzip


还有什么需要补充的吗?

这是我最近一直在使用的一个片段,作为使用.htaccess压缩文件的封面。我肯定我曾经在这里找到过它,但不幸的是,我没有注意到我找到它的用户

<IfModule mod_deflate.c>
  #Force deflate for mangled headers
  <IfModule mod_setenvif.c>
    <IfModule mod_headers.c>
      SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
      RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
    </IfModule>
  </IfModule>

  #HTML, TXT, CSS, JavaScript, JSON, XML, HTC:
  <IfModule filter_module>
    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 $application/x-font-ttf
    FilterProvider  COMPRESS  DEFLATE resp=Content-Type $font/opentype
    FilterChain     COMPRESS
    FilterProtocol  COMPRESS  DEFLATE change=yes;byteranges=no
  </IfModule>

  <IfModule !mod_filter.c>
    #Legacy versions of 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 
    AddOutputFilterByType DEFLATE application/atom+xml
    AddOutputFilterByType DEFLATE image/svg+xml application/vnd.ms-fontobject 
    AddOutputFilterByType DEFLATE application/x-font-ttf font/opentype
  </IfModule>
</IfModule>

#对损坏的收割台强制放气
SetEnvIfNoCase^((gzip | deflate)\s*,?\s*)+|[X~-]{4,13}$有接受编码
RequestHeader追加接受编码“gzip,deflate”env=HAVE_Accept-Encoding
#HTML、TXT、CSS、JavaScript、JSON、XML、HTC:
FilterDeclare压缩
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=内容类型$application/x-font-ttf
FilterProvider COMPRESS DEFLATE resp=内容类型$font/opentype
过滤链压缩
过滤器协议压缩放气变化=是;byteranges=否
#Apache的遗留版本
AddOutputFilterByType DEFLATE text/html text/plain text/css application/json
AddOutputFilterByType DEFLATE应用程序/javascript
AddOutputFilterByType DEFLATE text/xml应用程序/xml文本/x组件
AddOutputFilterByType DEFLATE应用程序/xhtml+xml应用程序/rss+xml
AddOutputFilterByType DEFLATE应用程序/atom+xml
AddOutputFilterByType DEFLATE image/svg+xml应用程序/vnd.ms-fontobject
AddOutputFilterByType放气应用程序/x-font-ttf font/opentype