To enable data compression for unmanaged hosting accounts, you must modify the.htaccess file. One method to enable data compression by providing file extensions is shown by the sample configuration that follows:

<IfModule mod_deflate.c>
    <filesMatch "\.(js|css|html|php)$">
        SetOutputFilter DEFLATE
    </filesMatch>
</IfModule>

In this case, any file with the extensions.js,.css,.html, or.php is compressed by Apache.

As an alternative, MIME types can be used to designate which files to compress. One example of how to do this is shown in the following sample configuration:

<IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css text/javascript application/javascript
</IfModule> 

In this example, Apache compresses any file that uses one of the MIME types referenced by the AddOutputFilterByType directive.

You can remove the relevant lines from the.htaccess file or comment them out by prefixing each line with # to stop data compression.

To verify that data compression is active, please see Determining if compression is enabled below.
Was this answer helpful? 0 Users Found This Useful (0 Votes) htaccess file, htaccess rule