0

When I enable mod_deflate in .htaccess under Apache 2.2.23, I get a site wide 500 server error.

Here is the code I am using:

<IfModule mod_deflate.c>
# Don't compress certain content under Apache 2.x
<Location />
    SetOutputFilter DEFLATE
    SetEnvIfNoCase Request_URI  \
    \.(?:gif|jpe?g|png)$ no-gzip dont-vary
    SetEnvIfNoCase Request_URI  \
    \.(?:exe|t?gz|zip|gz2|sit|rar)$ no-gzip dont-vary
    SetEnvIfNoCase Request_URI \/(shipments)\.php no-gzip dont-vary
    SetEnvIfNoCase Request_URI \/(modules)\/ no-gzip dont-vary
</Location>

AddOutputFilterByType DEFLATE text/* application/x-javascript application/javascript application/x-httpd-php application/rss+xml application/atom_xml

<ifmodule mod_headers.c>
    # properly handle requests coming from behind proxies
    Header append Vary User-Agent
</ifmodule>
</IfModule>

Any ideas what could be causing the error?

eComEvo
  • 971
  • 3
  • 17
  • 31

2 Answers2

1

The problem was with the "Location" tag. It does not belong there.

eComEvo
  • 971
  • 3
  • 17
  • 31
0

A guess.....try removing the nested ifmodule construction and see what happens.

EightBitTony
  • 9,211
  • 1
  • 32
  • 46
mdpc
  • 11,698
  • 28
  • 51
  • 65