Title: Compression help
Last modified: August 19, 2016

---

# Compression help

 *  [samq@labelmedia.co.uk](https://wordpress.org/support/users/samqlabelmediacouk/)
 * (@samqlabelmediacouk)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/compression-help/)
 * I have wordpress running a 1&1 server. To add compression to my to site I added:
 * `AddType x-mapp-php5 .php .shtml .html .htm .txt .js .css` to my htaccess.
 * Then I added the following into a php.ini file:
 *     ```
       output_handler=ob_gzhandler
       auto_prepend_file=/kunden/homepages/27/d292845089/htdocs/PelicanFly/headers.php
       ```
   
 * I then created a file called header.php with this included:
 *     ```
       <?
       $pathinfo=pathinfo($_ENV['SCRIPT_FILENAME']);
       $extension=$pathinfo['extension'];
       $offset = 60 * 60 * 24 * 30;
       if($extension=='css'){
       header('Content-type: text/css; charset=utf-8');
       header("Expires: ".gmdate("D, d M Y H:i:s", time() + $offset)." GMT");
       header("Vary: Accept-Encoding");
       }
       if($extension=='js'){
       header('Content-type: text/javascript; charset=utf-8');
       header("Expires: ".gmdate("D, d M Y H:i:s", time() + $offset)." GMT");
       header("Vary: Accept-Encoding");
       }
       ?>
       ```
   
 * This compressed everything fine but it breaks my wordpress admin. It basically
   looks like the styles are broken.
 * If i remove `.css` from
    `AddType x-mapp-php5 .php .shtml .html .htm .txt .js.
   css`
 * so:
 * `AddType x-mapp-php5 .php .shtml .html .htm .txt .js .`
 * It works fine because it is not compressing the css. I found a half solution 
   to add:
 * `define('WP_DEBUG', true);`
 * to my wp-config file which fixes the syles but ofcourseshows all the debug logs
   in my wordpress admin. Can anyone help? I’m getting short on hair.
 * Muchos gracias.

The topic ‘Compression help’ is closed to new replies.

## Tags

 * [compression](https://wordpress.org/support/topic-tag/compression/)
 * [css](https://wordpress.org/support/topic-tag/css/)
 * [gzip](https://wordpress.org/support/topic-tag/gzip/)
 * [wp_debug](https://wordpress.org/support/topic-tag/wp_debug/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [samq@labelmedia.co.uk](https://wordpress.org/support/users/samqlabelmediacouk/)
 * Last activity: [15 years, 2 months ago](https://wordpress.org/support/topic/compression-help/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
