Index: javascript_aggregator.module ========================================================= --- javascript_aggregator.module (revision 1.17.2.19) +++ javascript_aggregator.module Wed Apr 14 02:03:47 CEST 2010 @@ -28,6 +28,13 @@ '#default_value' => variable_get('javascript_aggregator_gzip', FALSE), '#weight' => 3, ); + $form['bandwidth_optimizations']['javascript_aggregator_no_htaccess'] = array( + '#type' => 'checkbox', + '#title' => t('Do not auto generate .htaccess file (experts only)'), + '#description' => t("If you want to use GZipping and your host doesn't like multiple .htaccess files check this option, together with the option above to bypass htaccess file generation and follow directions in the README.txt."), + '#default_value' => variable_get('javascript_aggregator_no_htaccess', FALSE), + '#weight' => 5, + ); $form['bandwidth_optimizations']['javascript_aggregator_jsminplus'] = array( '#type' => 'checkbox', '#title' => t('Use JSMin+ instead of JSMin'), @@ -35,7 +42,6 @@ '#default_value' => variable_get('javascript_aggregator_jsminplus', FALSE), '#weight' => 4, ); - } } @@ -130,7 +136,7 @@ } // 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 Index: README.txt ========================================================= --- README.txt (revision 1.9.2.2) +++ README.txt Wed Apr 14 02:05:38 CEST 2010 @@ -34,3 +34,26 @@ 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, together with the option "GZip JavaScript" + + +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 ### \ No newline at end of file