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} ^(/admin|/cache|/misc|/modules|/sites|/system|/themes|/user/login) [OR]
RewriteCond %{HTTP_COOKIE} DRUPAL_UID
RewriteRule .? - [S=11]
#GZIP
# Skip Gzip section if it can't take gzip
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/index.html.gz -f
RewriteRule ^(.*)$ $cache_dir/$gzip_dir/$server_name/index.html.gz [L]
# subdir root
RewriteCond %{REQUEST_URI} ^($drupal_subdir)(.*)$
RewriteCond $document_root$drupal_subdir/$cache_dir/$gzip_dir/$server_name%2 -d
RewriteCond $document_root$drupal_subdir/$cache_dir/$gzip_dir/$server_name%2/index.html.gz -f
RewriteRule ^(.*)$ $cache_dir/$gzip_dir/$server_name%2/index.html.gz [L]
# non root
RewriteCond %{REQUEST_URI} ^($drupal_subdir)(.*)$
RewriteCond $document_root$drupal_subdir/$cache_dir/$gzip_dir/$server_name%2.html.gz -f
RewriteRule ^(.*)$ $cache_dir/$gzip_dir/$server_name%2.html.gz [L]
# url variables
RewriteCond %{REQUEST_URI} ^($drupal_subdir)(.*)$
RewriteCond $document_root$drupal_subdir/$cache_dir/$gzip_dir/$server_name%2_%{QUERY_STRING}.html.gz -f
RewriteRule ^(.*)$ $cache_dir/$gzip_dir/$server_name%2_%{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/index.html [L]
# subdir root
RewriteCond %{REQUEST_URI} ^($drupal_subdir)(.*)$
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_URI} ^($drupal_subdir)(.*)$
RewriteCond $document_root$drupal_subdir/$cache_dir/$server_name%2.html -f
RewriteRule ^(.*)$ $cache_dir/$server_name%2.html [L]
# url variables
RewriteCond %{REQUEST_URI} ^($drupal_subdir)(.*)$
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() . "
";