Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Site Crash: .htaccess buggered


LPH2005
Participant

@lph2005

This turns out to be a buggered up .htaccess – and since I didn’t touch it – something in a plugin went rummaging through the file and wiped out the optimizations.

Here is my current one – maybe someone can share a really good one that is optimized:

`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

Header unset ETag
FileETag None

# Insert filter
SetOutputFilter DEFLATE

# Netscape 4.x has some problems…
BrowserMatch ^Mozilla/4 gzip-only-text/html

# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4.0[678] no-gzip

# NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48
# the above regex won’t work. You can use the following
# workaround to get the desired effect:
BrowserMatch bMSI[E] !no-gzip !gzip-only-text/html

# Don’t compress images
SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png|ico)$ no-gzip

RewriteEngine on
RewriteRule ^(.*).(d+)(_m_d+)?.([^.]+)$ $1.$4 [L,QSA]

ExpiresActive On
ExpiresByType image/png “access plus 1 year”
ExpiresByType image/gif “access plus 1 year”
ExpiresByType image/jpeg “access plus 1 year”
ExpiresByType image/vnd.microsoft.icon “access plus 1 year”
ExpiresByType text/css “access plus 1 year”
ExpiresByType application/x-javascript “access plus 1 year”
ExpiresByType application/javascript “access plus 1 year”
ExpiresByType text/javascript “access plus 1 year”

`

Skip to toolbar