1、conf/httpd.conf
1) 去掉#loadmodule headers_module modules/mod_headers.so前面的注释#,
2) 添加loadmodule deflate_module modules/mod_deflate.so,
3) 去掉#include conf/extra/httpd-vhosts.conf前面的注释#。
2、conf/extra/httpd-vhosts.conf
在virtualhost中添加
setoutputfilter deflate browsermatch ^mozilla/4 gzip-only-text/html browsermatch ^mozilla/4\.0[678] no-gzip browsermatch \bmsie !no-gzip !gzip-only-text/html setenvifnocase request_uri \.(?:gif|jpe?g|png)$ no-gzip dont-vary header append vary user-agent env=!dont-vary
例如:
documentroot d:/apache2.2/htdocs/wef setoutputfilter deflate browsermatch ^mozilla/4 gzip-only-text/html browsermatch ^mozilla/4\.0[678] no-gzip browsermatch \bmsie !no-gzip !gzip-only-text/html setenvifnocase request_uri \.(?:gif|jpe?g|png)$ no-gzip dont-vary header append vary user-agent env=!dont-vary
希望本文所述对大家的php程序设计有所帮助。
