What should I do to fix compression error messages?

Did you just move your website to the new environment and are you suddenly getting a strange error message? This can happen, and the message looks different in every browser:

  • Chrome: ERR_CONTENT_DECODING_FAILED
  • Firefox: The page you are trying to view cannot be shown because it uses an invalid or unsupported form of compression.
  • Internet Explorer: shows a message stating there are connection problems.

What's going on? The browser expects a compressed file, but doesn't receive one. Instead, it receives the file as plain text, which causes the browser to stumble.

Fortunately, this is easy to fix. Add the following two lines to the .htaccess file in the root folder of your website:

php_flag zlib.output_compression onphp_value zlib.output_compression_level 5

After making this change, your website will display its pages properly again.

Related articles