Thursday, December 22, 2016

Disable Apache Encoding for a Specific Directory


     1. Create .htaccess file inside a directory

  eg  /var/www/test

  vi .htaccess

  1.  "*.gz.asc">
         RemoveEncoding .gz
     
  2. put a reqwrite rule to disable
    RewriteRule "\.js\.gz$" "-" [T=text/javascript,E=no-gzip:1] 

check apache for error

/etc/init.d/httpd -t

restart apache instance


run curl against the filname

curl -I  https://www.example.com/test.tgz.filename ( it should be displaying any content-encoding)

HTTP/1.1 200 OK
Date: Wed, 21 Dec 2016 21:48:54 GMT
Server: Apache
Strict-Transport-Security: max-age=1296000; includeSubDomains
Last-Modified: Tue, 13 Dec 2016 01:57:46 GMT
Accept-Ranges: bytes
Content-Length: 40617
Cache-Control: max-age=0
Expires: Wed, 21 Dec 2016 21:48:54 GMT
Vary: User-Agent
Content-Type: test/plain
Content-Language: en

No comments:

curl and cacert

curl -v --cacert cacert.pem https://www.example/cgi-bin/f ile.xgi -I -X POST