Getting gzip to work.
Posted: Sun Jan 13, 2013 9:36 pm
My hoster enabled gzip for me but now I have issues getting it to work.
After contacting them the adviced me to put the following code "somewhere" in php
The question is: where?
In my .htaccess I already have:
So after adding the code to php I should be up and running.
After contacting them the adviced me to put the following code "somewhere" in php

Code: Select all
<?php if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) ob_start("ob_gzhandler"); else ob_start(); ?>
In my .htaccess I already have:
Code: Select all
<IfModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file \.(html?|txt|css|js|php)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</IfModule>