javascript - .htaccess:FilterProvider问题

标签 javascript json .htaccess

这可能真的很简单,但我的编码员正在度假并且无法通讯,而我是一名图形设计师,具有相当基本的 HTML 和 CSS 知识。这超出了我的范围。

我们的一个客户站点遇到了此问题:

.htaccess: FilterProvider takes three arguments, filter-name provider-name match-expression

我认为它与 .htaccess 文件的这一部分有关,但我不知道答案是什么:

# Force deflate for mangled headers 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 append 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


# 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/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/

相关文章:

javascript - 无法使用 localStorage 手动生成 id

javascript - AngularJS - 添加每行的重复、不同计数器

javascript - AngularJS $uibModal 不工作

php - 子目录中的 Zend 应用程序使 Zend 布局链接正常工作

javascript - 将单个参数传递给具有默认值的函数

javascript - 使用 Node 中嵌套对象的字符串文字进行 JSON 解析

json - Google 应用引擎、ndb 和 Json

Spring MVC 中的 Java 到 JSON 对象映射结果 400 Bad request 错误

php - 搜索引擎友好页面链接问题

php - htaccess 重命名为友好的 url