Header set Expires "Sun, 19 Nov 1978 05:00:00 GMT" Header set Cache-Control "no-store, no-cache, must-revalidate, post-check=0, pre-check=0" AddCharset utf-8 .html AddEncoding x-gzip .gz ForceType text/html # Serve file IF it exist on server RewriteCond %{REQUEST_FILENAME} \.\w{2,4}$ RewriteCond %{REQUEST_FILENAME} -f RewriteRule .* - [L] # Skip boost IF not get request OR uri has wrong dir OR cookie is set RewriteCond %{REQUEST_METHOD} !^GET$ [OR] RewriteCond %{REQUEST_URI} ^$drupal_subdir(/admin|/$cache_dir|/misc|/modules|/sites|/system|/themes|/user/login) [OR] RewriteCond %{HTTP_COOKIE} DRUPAL_UID RewriteRule .* - [S=11] #GZIP # Skip this section if it browser doesn't accept gzipped content RewriteCond %{HTTP:Accept-encoding} !gzip RewriteRule .* - [S=5] # Skip next 3 rules IF uri contains a query string RewriteCond %{QUERY_STRING} !^$ RewriteRule .* - [S=3] # root RewriteCond %{REQUEST_URI} ^$drupal_subdir/$ RewriteCond $document_root$drupal_subdir/$cache_dir/$gzip_dir/$server_name%{REQUEST_URI}index.html.gz -f RewriteRule .* $cache_dir/$gzip_dir/$server_name%{REQUEST_URI}index.html.gz [L] # subdir root RewriteCond $document_root$drupal_subdir/$cache_dir/$gzip_dir/$server_name%{REQUEST_URI} -d RewriteCond $document_root$drupal_subdir/$cache_dir/$gzip_dir/$server_name%{REQUEST_URI}/index.html.gz -f RewriteRule .* $cache_dir/$gzip_dir/$server_name%{REQUEST_URI}/index.html.gz [L] # non root RewriteCond $document_root$drupal_subdir/$cache_dir/$gzip_dir/$server_name%{REQUEST_URI}.html.gz -f RewriteRule .* $cache_dir/$gzip_dir/$server_name%{REQUEST_URI}.html.gz [L] # url variables RewriteCond $document_root$drupal_subdir/$cache_dir/$gzip_dir/$server_name%{REQUEST_URI}_%{QUERY_STRING}.html.gz -f RewriteRule .* $cache_dir/$gzip_dir/$server_name%{REQUEST_URI}_%{QUERY_STRING}.html.gz [L] #NORMAL # Skip next 3 rules IF uri contains a query string RewriteCond %{QUERY_STRING} !^$ RewriteRule .* - [S=3] # root RewriteCond %{REQUEST_URI} ^$drupal_subdir/$ RewriteCond $document_root$drupal_subdir/$cache_dir/$server_name/index.html -f RewriteRule .* $cache_dir/$server_name%{REQUEST_URI}index.html [L] # subdir root RewriteCond $document_root$drupal_subdir/$cache_dir/$server_name%{REQUEST_URI} -d RewriteCond $document_root$drupal_subdir/$cache_dir/$server_name%{REQUEST_URI}/index.html -f RewriteRule .* $cache_dir/$server_name%{REQUEST_URI}/index.html [L] # non root RewriteCond $document_root$drupal_subdir/$cache_dir/$server_name%{REQUEST_URI}.html -f RewriteRule .* $cache_dir/$server_name%{REQUEST_URI}.html [L] # url variables RewriteCond $document_root$drupal_subdir/$cache_dir/$server_name%{REQUEST_URI}_%{QUERY_STRING}.html -f RewriteRule .* $cache_dir/$server_name%{REQUEST_URI}_%{QUERY_STRING}.html [L] # BOOST END ETO; return $string; } echo "
" . boost_generate_htaccess() . "
";