Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using Apache to compress render HTML files but it's not working. Why? I'm usng hostmonster servers and YII PHP framework.


<IfModule deflate_module>
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/javascript text/css application/json application/javascript

# 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

# Do NOT compress localhost
#SetEnvIf Remote_Host no-gzip

# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary
share|improve this question

migrated from Jul 20 '12 at 15:23

This question came from our site for professional and enthusiast programmers.

I believe it is mod_deflate. Not deflate_module.

<IfModule mod_deflate>

Note: It looks like you took your code from the documentation. As noted in the docs, Do not use this unless you fully understand all the configuration details. As such, maybe start with just AddOutputFilterByType and expand from there.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.