Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

2 Answers

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

share|improve this answer
    
Might be better as a comment on the original post rather than an answer, unless you can flesh this out a bit. –  EightBitTony Dec 6 '12 at 8:05
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.