diff -urp javascript_aggregator.orig/javascript_aggregator.module javascript_aggregator/javascript_aggregator.module --- javascript_aggregator.orig/javascript_aggregator.module 2009-10-31 14:22:39.000000000 -0400 +++ javascript_aggregator/javascript_aggregator.module 2009-10-31 14:22:19.000000000 -0400 @@ -35,7 +35,13 @@ function javascript_aggregator_form_alte '#default_value' => variable_get('javascript_aggregator_jsminplus', FALSE), '#weight' => 4, ); - + $form['bandwidth_optimizations']['javascript_aggregator_no_htaccess'] = array( + '#type' => 'checkbox', + '#title' => t('GZip JS: Do not generate .htaccess file'), + '#description' => t('Sometimes your host does not like multiple .htaccess files. Enable this to bypass htaccess file generation. Follow directions in the README.txt if this is effecting you.'), + '#default_value' => variable_get('javascript_aggregator_no_htaccess', FALSE), + '#weight' => 5, + ); } } @@ -122,7 +128,7 @@ function _javascript_aggregator_minify($ } // Make sure the .htaccess file is active to handle GZipped JavaScript files. - if (!file_exists($htaccess)) { + if (!variable_get('javascript_aggregator_no_htaccess', FALSE) && !file_exists($htaccess)) { $htaccess_contents = << AddEncoding x-gzip .gz diff -urp javascript_aggregator.orig/README.txt javascript_aggregator/README.txt --- javascript_aggregator.orig/README.txt 2009-10-31 16:17:22.000000000 -0400 +++ javascript_aggregator/README.txt 2009-10-31 16:21:17.000000000 -0400 @@ -34,3 +34,26 @@ the module and you're done. This is due Thank you goes to webchick and her writings of the jQuery Update module for the idea of using the hook. + + +Issues +------ +Certain hosts do not like multiple .htaccess files. To get around this issue you need to: + +(1) copy the text below into drupal's root .htaccess file + +(2) enable the "GZip JS: Do not generate .htaccess file" checkbox. + + +Add this Inside the block, right before (add it to the bottom) + ### START JS GZIP ### + + AddEncoding x-gzip .gz + ForceType text/javascript + + + RewriteCond %{HTTP_USER_AGENT} !".*Safari.*" + RewriteCond %{HTTP:Accept-encoding} gzip + RewriteCond %{REQUEST_FILENAME}.gz -f + RewriteRule ^(.*)\.js $1.js.gz [L,QSA] + ### End JS GZIP ###