0
我试图在我的APACHE 2.2(OS:Linux centos)中实现HTTP压缩。其中.htaccess文件在APACHE(OS:Linux centos)服务器上是否需要更新
因为我已经得到了以下一段代码,它需要在以下URL的.htaccess中进行更新。但是我不知道在哪个.htaccess文件中需要更新APACHE(操作系统:Linux centos)服务器。在Apache服务器中有很多.htaccess文件。请指导我。
是否需要在.htaccess文件中添加以下代码之前,先安装或激活apache服务器中的任何模块。
http://www.askapache.com/htaccess/apache-speed-compression.html
除了图像压缩一切:
<Location />
# Insert filter
SetOutputFilter DEFLATE
# Netscape 4.x has some problems...
BrowserMatch ^Mozilla/4 gzip-only-text/html
# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4\.0[678] no-gzip
# MSIE masquerades as Netscape, but it is fine
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
# Don't compress images
SetEnvIfNoCase Request_URI \
\.(?:gif|jpe?g|png)$ no-gzip dont-vary
# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary
</Location>