Unless someone can see a better way to optimize this file, this is my final online version:
`php_value memory_limit 256M
RewriteEngine on
RewriteCond %{HTTP_HOST} ^thechembook.com [NC]
RewriteRule ^(.*)$ http://www.thechembook.com/$1 [L,R=301]
RewriteCond %{HTTP_HOST} ^thechemistrybook.com [NC]
RewriteRule ^(.*)$ http://www.thechembook.com/$1 [L,R=301]
RewriteCond %{HTTP_HOST} http://www.thechemistrybook.com [NC]
RewriteRule ^(.*)$ http://www.thechembook.com/$1 [L,R=301]
RewriteCond %{HTTP_HOST} http://www.chemhints.com [NC]
RewriteRule ^(.*)$ http://www.thechembook.com/$1 [L,R=301]
RewriteCond %{HTTP_HOST} ^chemhints.com [NC]
RewriteRule ^(.*)$ http://www.thechembook.com/$1 [L,R=301]
php_value session.gc_probability 1
php_value session.gc_divisor 100
php_value session.gc_maxlifetime 3600
php_value session.save_path /path/to/sessions
# Protect the htaccess file
Order Allow,Deny
Deny from all
# Protect wpconfig.php
Order Allow,Deny
Deny from all
# Disable directory browsing
Options All -Indexes
# BEGIN COMPRESSION AND CACHING
# Enable compression
AddOutputFilterByType DEFLATE text/css text/javascript application/x-javascript text/html text/plain text/xml image/x-icon
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4.0[678] no-gzip
BrowserMatch bMSIE !no-gzip !gzip-only-text/html
BrowserMatch bMSI[E] !no-gzip !gzip-only-text/html
# Make sure proxies deliver correct content
Header append Vary User-Agent env=!dont-vary
# Ensure proxies deliver compressed content correctly
Header append Vary Accept-Encoding
# No ETags, No Pragma
Header unset Pragma
Header unset ETag
# Default cache time to 1 year (31536000 sec)
Header set Cache-Control “max-age=31536000, public, must-revalidate”
# No ETags
FileETag none
# CACHE SETTINGS (mod_expires)
# Turn on Expires
ExpiresActive On
# set default to “access plus 1 year”
ExpiresDefault A31536000
# html – “modification plus 1 hour”
ExpiresByType text/html M3600
# css and JavaScript – “modification plus 6 weeks”
ExpiresByType text/css M3628800
ExpiresByType text/javascript M3628800
ExpiresByType application/x-javascript M3628800
# No cache for php-files
ExpiresActive Off
Header set Cache-Control “private, no-cache, no-store, proxy-revalidate, no-transform”
# END CACHING
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress`