mod_deflate설정시 파일 다운로드 에러

우선 tc//blog/blog/attachment/index.php 파일에서

$attachment[‘mime’] = $attachment[‘mime’] == “” ? “application/octet-stream” : $attachment[‘mime’];

mime타입이 없으면 옥텟스트림으로 mime타입을 바꿔주게 설정하였다.

또 deflate설정을 아래와 같이 변경해 exe파일이면 압축되지 않게 하였다.

물론 blog/attachment/index.php을 수정하지 않고 exe 확장자로 헤더에 정의 되어있으니 상관없긴 하지만
그래도 기분상^^

<Location />
    AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xhtml+xml
    AddOutputFilterByType DEFLATE text/css application/javascript text/javascript
    AddOutputFilterByType DEFLATE application/x-httpd-php application/x-httpd-fastphp application/x-httpd-eruby
    AddOutputFilterByType DEFLATE application/xml application/rss+xml application/atom+xml image/svg+xml


    # 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


    # NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48
    # the above regex won’t work. You can use the following
    # workaround to get the desired effect:
    #BrowserMatch bMSI[E] !no-gzip !gzip-only-text/html


    # Don’t compress images, compressed files, movies, audio files
    SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png)$ no-gzip dont-vary
    SetEnvIfNoCase Request_URI .(?:exe|t?gz|zip|bz2|sit|rar)$ no-gzip dont-vary
    SetEnvIfNoCase Request_URI .pdf$ no-gzip dont-vary
    SetEnvIfNoCase Request_URI .avi$ no-gzip dont-vary
    SetEnvIfNoCase Request_URI .mov$ no-gzip dont-vary
    SetEnvIfNoCase Request_URI .mp3$ no-gzip dont-vary
    SetEnvIfNoCase Request_URI .mp4$ no-gzip dont-vary
    SetEnvIfNoCase Request_URI .rm$ no-gzip dont-vary


    # Make sure proxies don’t deliver the wrong content
    Header append Vary User-Agent env=!dont-vary


    # n = 1..9 with 9 being the highest compression level. Standard is 6.
    # DeflateCompressionLevel
</Location>