本文介绍了htaccess的FilterProvider给错误500的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用的Apache / 2.4.4(UNIX)PHP / 5.5.3的OpenSSL / 1.0.1e的mod_perl / 2.0.8-dev的的Perl / v5.16.3 和我得到一个错误500当我尝试在浏览器中打开此页面 / xamppfiles / htdocs中/ WM /前端/ WWW / 下面,如果我的错误日志。

  [星期二17年3月18日:03:51.923726 2014] [核心:警惕] [PID 933】【客户端:: 1:51765] /应用/ XAMPP / xamppfiles / htdocs中/ WM /frontend/www/.htaccess:FilterProvider有三个参数,过滤器名供应商名称匹配-EX pression
 

这是我的htaccess的文件

 #------------------------------------- ---------------------------------
#Gzip已融为一体pression
#------------------------------------------------- ---------------------

< IfModule mod_deflate.c>

#强制放气的错位头developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping/
< IfModule mod_setenvif.c>
  < IfModule mod_headers.c>
    SetEnvIfNoCase ^(接受-EncodXng | X-CEPT-编码| X {15} |〜{15} |  -  {15})$ ^((GZIP |?放气)\ S * \ S *)+ | [X〜 - ] {4,13} $ HAVE_Accept,编码
    RequestHeader追加接受编码的gzip,紧缩ENV = HAVE_Accept,编码
  < / IfModule>
< / IfModule>

#HTML,TXT,CSS,JavaScript的,JSON,XML,HTC:
< IfModule filter_module>
  FilterDeclare COM $ P $干燥综合征
  FilterProvider COM $ P $干燥综合征DEFLATE RESP = Content-Type的$ text / html的
  FilterProvider COM $ P $干燥综合征DEFLATE RESP = Content-Type的$文本/ CSS
  FilterProvider COM $ P $干燥综合征DEFLATE RESP = Content-Type的$ text / plain的
  FilterProvider COM $ P $干燥综合征DEFLATE RESP =内容类型$为text / xml
  FilterProvider COM $ P $干燥综合征DEFLATE RESP = Content-Type的$文本/ x分量
  FilterProvider COM $ P $干燥综合征DEFLATE RESP =内容类型$应用程序/ JavaScript的
  FilterProvider COM $ P $干燥综合征DEFLATE RESP =内容类型$应用程序/ JSON
  FilterProvider COM $ P $干燥综合征DEFLATE RESP =内容类型$应用程序/ XML
  FilterProvider COM $ P $干燥综合征DEFLATE RESP =内容类型$应用程序/ xhtml + xml
  FilterProvider COM $ P $干燥综合征DEFLATE RESP =内容类型$应用程序/的RSS + XML
  FilterProvider COM $ P $干燥综合征DEFLATE RESP =内容类型$应用程序/原子+ XML
  FilterProvider COM $ P $干燥综合征DEFLATE RESP =内容类型$应用程序/ vnd.ms-fontobject
  FilterProvider COM $ P $干燥综合征DEFLATE RESP = Content-Type的$图像/ SVG + XML
  FilterProvider COM $ P $干燥综合征DEFLATE RESP =内容类型$应用程序/ x-字体,TTF
  FilterProvider COM $ P $干燥综合征DEFLATE RESP =内容类型$字型/ OpenType字体
  的FilterChain COM $ P $干燥综合征
  FilterProtocol COM $ P $干燥综合征DEFLATE变化= YES,字节范围=无
< / IfModule>

<!IfModule mod_filter.c>
  #旧的Apache版本
  AddOutputFilterByType DEFLATE text / html的文本/纯文本/ css的应用程序/ JSON
  AddOutputFilterByType DEFLATE应用程序/ JavaScript的
  AddOutputFilterByType DEFLATE文/ XML应用程序/ XML文本/ x分量
  AddOutputFilterByType DEFLATE是application / xhtml + XML应用程序/ RSS + XML应用程序/原子+ XML
  AddOutputFilterByType DEFLATE图像/ SVG + XML应用程序/ vnd.ms-fontobject应用程序/ x-字体TTF字库/ OpenType字体
< / IfModule>
< / IfModule>
 

我想这一点,但没有运气或者

 < IfVersion> = 2.4.4>
< IfModule filter_module>
  FilterDeclare COM $ P $干燥综合征
  FilterProvider COM $ P $干燥综合征DEFLATE RESP = Content-Type的$ text / html的
  FilterProvider COM $ P $干燥综合征DEFLATE RESP = Content-Type的$文本/ CSS
  FilterProvider COM $ P $干燥综合征DEFLATE RESP = Content-Type的$ text / plain的
  FilterProvider COM $ P $干燥综合征DEFLATE RESP =内容类型$为text / xml
  FilterProvider COM $ P $干燥综合征DEFLATE RESP = Content-Type的$文本/ x分量
  FilterProvider COM $ P $干燥综合征DEFLATE RESP =内容类型$应用程序/ JavaScript的
  FilterProvider COM $ P $干燥综合征DEFLATE RESP =内容类型$应用程序/ JSON
  FilterProvider COM $ P $干燥综合征DEFLATE RESP =内容类型$应用程序/ XML
  FilterProvider COM $ P $干燥综合征DEFLATE RESP =内容类型$应用程序/ xhtml + xml
  FilterProvider COM $ P $干燥综合征DEFLATE RESP =内容类型$应用程序/的RSS + XML
  FilterProvider COM $ P $干燥综合征DEFLATE RESP =内容类型$应用程序/原子+ XML
  FilterProvider COM $ P $干燥综合征DEFLATE RESP =内容类型$应用程序/ vnd.ms-fontobject
  FilterProvider COM $ P $干燥综合征DEFLATE RESP = Content-Type的$图像/ SVG + XML
  FilterProvider COM $ P $干燥综合征DEFLATE RESP =内容类型$应用程序/ x-字体,TTF
  FilterProvider COM $ P $干燥综合征DEFLATE RESP =内容类型$字型/ OpenType字体
  的FilterChain COM $ P $干燥综合征
  FilterProtocol COM $ P $干燥综合征DEFLATE变化= YES,字节范围=无
< / IfModule>
< / IfVersion>

< IfVersion< = 2.4.4>
< IfModule filter_module>
    FilterDeclare COM $ P $干燥综合征
    FilterProvider COM $ P $干燥综合征DEFLATE%{} CONTENT_TYPE ='text / html的'。
    FilterProvider COM $ P $干燥综合征DEFLATE%{} CONTENT_TYPE ='文/ CSS'
    FilterProvider COM $ P $干燥综合征DEFLATE%{} CONTENT_TYPE ='text / plain的'
    FilterProvider COM $ P $干燥综合征DEFLATE%{} CONTENT_TYPE ='为text / xml'
    FilterProvider COM $ P $干燥综合征DEFLATE%{} CONTENT_TYPE ='文本/ x分量'
    FilterProvider COM $ P $干燥综合征DEFLATE%{} CONTENT_TYPE ='应用程序/ JavaScript的'
    FilterProvider COM $ P $干燥综合征DEFLATE%{} CONTENT_TYPE ='应用程序/ JSON'
    FilterProvider COM $ P $干燥综合征DEFLATE%{} CONTENT_TYPE ='应用程序/ XML'
    FilterProvider COM $ P $干燥综合征DEFLATE%{} CONTENT_TYPE ='是application / xhtml + xml的'
    FilterProvider COM $ P $干燥综合征DEFLATE%{} CONTENT_TYPE ='应用程序/ RSS + XML'
    FilterProvider COM $ P $干燥综合征DEFLATE%{} CONTENT_TYPE ='应用程序/原子+ XML'
    FilterProvider COM $ P $干燥综合征DEFLATE%{} CONTENT_TYPE ='应用程序/ vnd.ms-fontobject'
    FilterProvider COM $ P $干燥综合征DEFLATE%{} CONTENT_TYPE ='图像/ SVG + XML'
    FilterProvider COM $ P $干燥综合征DEFLATE%{} CONTENT_TYPE ='图像/ X-图标'
    FilterProvider COM $ P $干燥综合征DEFLATE%{} CONTENT_TYPE ='应用程序/ x-字体TTF'
    FilterProvider COM $ P $干燥综合征DEFLATE%{} CONTENT_TYPE ='字型/ OpenType字体'
    的FilterChain COM $ P $干燥综合征
    FilterProtocol COM $ P $干燥综合征DEFLATE变化= YES,字节范围=无
< / IfModule>
< / IfVersion>
 

解决方案

您的逻辑是有缺陷的。你有%{CONTENT_TYPE}语法被用于旧版本,两者IfVersion条件语句将匹配2.4.4版本,因为你有等于两个条件句。

这应该工作:

 < IfVersion< 2.4.4>
< IfModule filter_module>
FilterDeclare COM $ P $干燥综合征
FilterProvider COM $ P $干燥综合征DEFLATE RESP = Content-Type的$ text / html的
FilterProvider COM $ P $干燥综合征DEFLATE RESP = Content-Type的$文本/ CSS
FilterProvider COM $ P $干燥综合征DEFLATE RESP = Content-Type的$ text / plain的
FilterProvider COM $ P $干燥综合征DEFLATE RESP =内容类型$为text / xml
FilterProvider COM $ P $干燥综合征DEFLATE RESP = Content-Type的$文本/ x分量
FilterProvider COM $ P $干燥综合征DEFLATE RESP =内容类型$应用程序/ JavaScript的
FilterProvider COM $ P $干燥综合征DEFLATE RESP =内容类型$应用程序/ JSON
FilterProvider COM $ P $干燥综合征DEFLATE RESP =内容类型$应用程序/ XML
FilterProvider COM $ P $干燥综合征DEFLATE RESP =内容类型$应用程序/ xhtml + xml
FilterProvider COM $ P $干燥综合征DEFLATE RESP =内容类型$应用程序/的RSS + XML
FilterProvider COM $ P $干燥综合征DEFLATE RESP =内容类型$应用程序/原子+ XML
FilterProvider COM $ P $干燥综合征DEFLATE RESP =内容类型$应用程序/ vnd.ms-fontobject
FilterProvider COM $ P $干燥综合征DEFLATE RESP = Content-Type的$图像/ SVG + XML
FilterProvider COM $ P $干燥综合征DEFLATE RESP =内容类型$应用程序/ x-字体,TTF
FilterProvider COM $ P $干燥综合征DEFLATE RESP =内容类型$字型/ OpenType字体
的FilterChain COM $ P $干燥综合征
FilterProtocol COM $ P $干燥综合征DEFLATE变化= YES,字节范围=无
< / IfModule>
< / IfVersion>

< IfVersion> = 2.4.4>
< IfModule filter_module>
FilterDeclare COM $ P $干燥综合征
FilterProvider COM $ P $干燥综合征DEFLATE%{} CONTENT_TYPE ='text / html的'。
FilterProvider COM $ P $干燥综合征DEFLATE%{} CONTENT_TYPE ='文/ CSS'
FilterProvider COM $ P $干燥综合征DEFLATE%{} CONTENT_TYPE ='text / plain的'
FilterProvider COM $ P $干燥综合征DEFLATE%{} CONTENT_TYPE ='为text / xml'
FilterProvider COM $ P $干燥综合征DEFLATE%{} CONTENT_TYPE ='文本/ x分量'
FilterProvider COM $ P $干燥综合征DEFLATE%{} CONTENT_TYPE ='应用程序/ JavaScript的'
FilterProvider COM $ P $干燥综合征DEFLATE%{} CONTENT_TYPE ='应用程序/ JSON'
FilterProvider COM $ P $干燥综合征DEFLATE%{} CONTENT_TYPE ='应用程序/ XML'
FilterProvider COM $ P $干燥综合征DEFLATE%{} CONTENT_TYPE ='是application / xhtml + xml的'
FilterProvider COM $ P $干燥综合征DEFLATE%{} CONTENT_TYPE ='应用程序/ RSS + XML'
FilterProvider COM $ P $干燥综合征DEFLATE%{} CONTENT_TYPE ='应用程序/原子+ XML'
FilterProvider COM $ P $干燥综合征DEFLATE%{} CONTENT_TYPE ='应用程序/ vnd.ms-fontobject'
FilterProvider COM $ P $干燥综合征DEFLATE%{} CONTENT_TYPE ='图像/ SVG + XML'
FilterProvider COM $ P $干燥综合征DEFLATE%{} CONTENT_TYPE ='图像/ X-图标'
FilterProvider COM $ P $干燥综合征DEFLATE%{} CONTENT_TYPE ='应用程序/ x-字体TTF'
FilterProvider COM $ P $干燥综合征DEFLATE%{} CONTENT_TYPE ='字型/ OpenType字体'
的FilterChain COM $ P $干燥综合征
FilterProtocol COM $ P $干燥综合征DEFLATE变化= YES,字节范围=无
< / IfModule>
< / IfVersion>
 

I'm using Apache/2.4.4 (Unix) PHP/5.5.3 OpenSSL/1.0.1e mod_perl/2.0.8-dev Perl/v5.16.3, and i get an Error 500 when i try opening this page in my browser/xamppfiles/htdocs/wm/frontend/www/ Below if my error log.

[Tue Mar 18 17:03:51.923726 2014] [core:alert] [pid 933] [client ::1:51765] /Applications/XAMPP/xamppfiles/htdocs/wm/frontend/www/.htaccess: FilterProvider takes three arguments, filter-name provider-name match-expression

here is my htaccess file

   # ----------------------------------------------------------------------
# Gzip compression
# ----------------------------------------------------------------------

<IfModule mod_deflate.c>

# Force deflate for mangled headers developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping/
<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 application/atom+xml
  AddOutputFilterByType DEFLATE image/svg+xml application/vnd.ms-fontobject application/x-font-ttf font/opentype
</IfModule>
</IfModule>

i tried this, but no luck either

<IfVersion >= 2.4.4>
<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>
</IfVersion>

<IfVersion <= 2.4.4>
<IfModule filter_module>
    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
</IfModule>
</IfVersion>
解决方案

Your logic is flawed. You have the %{Content_Type} syntax being used for the older version, and both IfVersion conditionals will match version 2.4.4 because you have "or equal to" on both conditionals.

This should work:

<IfVersion < 2.4.4>
<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>
</IfVersion>

<IfVersion >= 2.4.4>
<IfModule filter_module>
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
</IfModule>
</IfVersion>

这篇关于htaccess的FilterProvider给错误500的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-12 13:12