Header add Expires "Sun, 19 Nov 1978 05:00:00 GMT" Header add Cache-Control "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] #GZIP # root RewriteCond %{REQUEST_METHOD} ^GET$ RewriteCond %{REQUEST_URI} ^/$ RewriteCond %{QUERY_STRING} ^$ RewriteCond %{HTTP_COOKIE} !DRUPAL_UID RewriteCond %{HTTP:Accept-encoding} gzip RewriteCond $document_root/$cache_dir/$gzip_dir/$server_name/index.html.gz -f RewriteRule ^(.*)$ $cache_dir/$gzip_dir/$server_name/index.html.gz [L] # subdir root RewriteCond %{REQUEST_METHOD} ^GET$ RewriteCond %{REQUEST_URI} !(^/admin|^/cache|^/misc|^/modules|^/sites|^/system|^/themes|^/user/login) RewriteCond %{QUERY_STRING} ^$ RewriteCond %{HTTP_COOKIE} !DRUPAL_UID RewriteCond %{HTTP:Accept-encoding} gzip RewriteCond $document_root/$cache_dir/$gzip_dir$server_name%{REQUEST_URI} -d RewriteCond $document_root/$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 %{REQUEST_METHOD} ^GET$ RewriteCond %{REQUEST_URI} !(^/admin|^/cache|^/misc|^/modules|^/sites|^/system|^/themes|^/user/login) RewriteCond %{QUERY_STRING} ^$ RewriteCond %{HTTP_COOKIE} !DRUPAL_UID RewriteCond %{HTTP:Accept-encoding} gzip RewriteCond $document_root/$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 %{REQUEST_METHOD} ^GET$ RewriteCond %{REQUEST_URI} !(^/admin|^/cache|^/misc|^/modules|^/sites|^/system|^/themes|^/user/login) RewriteCond %{QUERY_STRING} !^$ RewriteCond %{HTTP_COOKIE} !DRUPAL_UID RewriteCond %{HTTP:Accept-encoding} gzip RewriteCond $document_root/$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 # root RewriteCond %{REQUEST_METHOD} ^GET$ RewriteCond %{REQUEST_URI} ^/$ RewriteCond %{QUERY_STRING} ^$ RewriteCond %{HTTP_COOKIE} !DRUPAL_UID RewriteCond $document_root/$cache_dir/$server_name/index.html -f RewriteRule ^(.*)$ $cache_dir/$server_name/index.html [L] # subdir root RewriteCond %{REQUEST_METHOD} ^GET$ RewriteCond %{REQUEST_URI} !(^/admin|^/cache|^/misc|^/modules|^/sites|^/system|^/themes|^/user/login) RewriteCond %{QUERY_STRING} ^$ RewriteCond %{HTTP_COOKIE} !DRUPAL_UID RewriteCond $document_root/$cache_dir/$server_name%{REQUEST_URI} -d RewriteCond $document_root/$cache_dir/$server_name%{REQUEST_URI}/index.html -f RewriteRule ^(.*)$ $cache_dir/$server_name%{REQUEST_URI}/index.html [L] # non root RewriteCond %{REQUEST_METHOD} ^GET$ RewriteCond %{REQUEST_URI} !(^/admin|^/cache|^/misc|^/modules|^/sites|^/system|^/themes|^/user/login) RewriteCond %{QUERY_STRING} ^$ RewriteCond %{HTTP_COOKIE} !DRUPAL_UID RewriteCond $document_root/$cache_dir/$server_name%{REQUEST_URI}.html -f RewriteRule ^(.*)$ $cache_dir/$server_name%{REQUEST_URI}.html [L] # url variables RewriteCond %{REQUEST_METHOD} ^GET$ RewriteCond %{REQUEST_URI} !(^/admin|^/cache|^/misc|^/modules|^/sites|^/system|^/themes|^/user/login) RewriteCond %{QUERY_STRING} !^$ RewriteCond %{HTTP_COOKIE} !DRUPAL_UID RewriteCond $document_root/$cache_dir/$server_name%{REQUEST_URI}_%{QUERY_STRING}.html -f RewriteRule ^(.*)$ $cache_dir/$server_name%{REQUEST_URI}_%{QUERY_STRING}.html [L] # BOOST END ETO; } else { $string = << Header add Expires "Sun, 19 Nov 1978 05:00:00 GMT" Header add Cache-Control "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] #GZIP # root RewriteCond %{REQUEST_METHOD} ^GET$ RewriteCond %{REQUEST_URI} ^(/$drupal_subdir)(/)$ RewriteCond %{QUERY_STRING} ![\=]+ RewriteCond %{HTTP_COOKIE} !DRUPAL_UID RewriteCond %{HTTP:Accept-encoding} gzip RewriteCond $document_root/$drupal_subdir/$cache_dir/$gzip_dir/$server_name/index.html.gz -f RewriteRule ^(.*)$ $cache_dir/$gzip_dir/$server_name/index.html.gz [L] #NORMAL # root RewriteCond %{REQUEST_METHOD} ^GET$ RewriteCond %{REQUEST_URI} ^(/$drupal_subdir)(/)$ RewriteCond %{QUERY_STRING} ![\=]+ RewriteCond %{HTTP_COOKIE} !DRUPAL_UID RewriteCond $document_root/$drupal_subdir/$cache_dir/$server_name/index.html -f RewriteRule ^(.*)$ $cache_dir/$server_name/index.html [L] # subdir root RewriteCond %{REQUEST_METHOD} ^GET$ RewriteCond %{REQUEST_URI} ^(/$drupal_subdir)(.*)$ RewriteCond %2 !(^/admin|^/$cache_dir|^/misc|^/modules|^/sites|^/system|^/themes|^/user/login) RewriteCond %{QUERY_STRING} ![\=]+ RewriteCond %{HTTP_COOKIE} !DRUPAL_UID RewriteCond $document_root/$drupal_subdir/$cache_dir/$server_name%2 -d RewriteCond $document_root/$drupal_subdir/$cache_dir/$server_name%2/index.html -f RewriteRule ^(.*)$ $cache_dir/$server_name%2/index.html [L] # non root RewriteCond %{REQUEST_METHOD} ^GET$ RewriteCond %{REQUEST_URI} ^(/$drupal_subdir)(.*)$ RewriteCond %2 !(^/admin|^/$cache_dir|^/misc|^/modules|^/sites|^/system|^/themes|^/user/login) RewriteCond %{QUERY_STRING} ![\=]+ RewriteCond %{HTTP_COOKIE} !DRUPAL_UID RewriteCond $document_root/$drupal_subdir/$cache_dir/$server_name/%2.html -f RewriteRule ^(.*)$ $cache_dir/$server_name%2.html [L] # url variables RewriteCond %{REQUEST_METHOD} ^GET$ RewriteCond %{REQUEST_URI} ^(/$drupal_subdir)(.*)$ RewriteCond %2 !(^/admin|^/$cache_dir|^/misc|^/modules|^/sites|^/system|^/themes|^/user/login) RewriteCond %{QUERY_STRING} !^$ RewriteCond %{HTTP_COOKIE} !DRUPAL_UID RewriteCond $document_root/$drupal_subdir/$cache_dir/$server_name%2_%{QUERY_STRING}.html -f RewriteRule ^(.*)$ $cache_dir/$server_name%2_%{QUERY_STRING}.html [L] # BOOST END ETO; } return $string; } echo "
" . boost_generate_htaccess('') . "\n\n\n\n\n\n\n" . boost_generate_htaccess('drupal') . "
";