drupal 7 - web server/hosting note related to aggreate and compress files setting

By jason on 08/05/2013

After all the hard work put into designing and developing a site, the final launch to the production hosting environment can get exciting.
There are a variety of web server's out there - most common one being apache, however don't discount IIS, lighthttpd, and others.

We ran into a situation on Network Solutions, where the Aggregate and Compress Javascript and CSS files settings were not working..actually, they were causing all sorts of issues.

Turns out it's a simple .htaccess solution: http://drupal.org/node/1335366#comment-5621446

Comment out the following:
# Rules to correctly serve gzip compressed CSS and JS files.
# Requires both mod_rewrite and mod_headers to be enabled.
#
# # Serve gzip compressed CSS files if they exist and the client accepts gzip.
# RewriteCond %{HTTP:Accept-encoding} gzip
# RewriteCond %{REQUEST_FILENAME}\.gz -s
# RewriteRule ^(.*)\.css $1\.css\.gz [QSA]
#
# Serve gzip compressed JS files if they exist and the client accepts gzip.
# RewriteCond %{HTTP:Accept-encoding} gzip
# RewriteCond %{REQUEST_FILENAME}\.gz -s
# RewriteRule ^(.*)\.js $1\.js\.gz [QSA]
#
# # Serve correct content types, and prevent mod_deflate double gzip.
# RewriteRule \.css\.gz$ - [T=text/css,E=no-gzip:1]
# RewriteRule \.js\.gz$ - [T=text/javascript,E=no-gzip:1]
#
#
# # Serve correct encoding type.
# Header append Content-Encoding gzip
# # Force proxies to cache gzipped & non-gzipped css/js files separately.
# Header append Vary Accept-Encoding
#
#
#

Hope that saves someone some time :)

For what it's worth, Network Solutions also had improper file and directory permissions within the /sites/default/files directory..which caused some issues related to the image styles, file uploads, and also the aggregate and compress setting.

drupal setting