Skip to:
Content
Pages
Categories
Search
Top
Bottom

Site Crash: .htaccess buggered


  • LPH2005
    Participant

    @lph2005

    OK. The site is down with the following in the error logs:

    [11-Sep-2010 19:22:10] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘)’ at line 1 for query SELECT leader_id, id FROM wp_bp_follow WHERE follower_id = 1 AND leader_id IN () made by require, require_once, include, locate_template, load_template, require_once, dynamic_sidebar, call_user_func_array, WidgetCache->widget_cache_redirected_callback, call_user_func_array, WP_Widget->display_callback, BP_Core_Whos_Online_Widget->widget, bp_has_members, apply_filters, call_user_func_array, bp_follow_inject_member_follow_status, BP_Follow->bulk_check_follow_status

    UPDATE: See second post about .htaccess. Do you have a better (optimized) .htaccess?

Viewing 5 replies - 1 through 5 (of 5 total)

  • 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”

    `


    LPH2005
    Participant

    @lph2005

    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`

    Do you not have access to your httpd.conf? Your .htaccess is starting to read like a primary conf file, as a rule use of ..htaccess should be avoided or be kept to a minimum where possible as it’s a big performance hit on a server.


    LPH2005
    Participant

    @lph2005

    I do not have access to the httpd.conf file …

    Oh ok fair enough, however some of those directives you are trying to state should in fact be set in httpd.conf already e.g FilesMatch should be set to deny access to .htaccess, and do you know then if AllowOverride ALL is set as I would expect a host to restrict that to a specific set of directives only.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Site Crash: .htaccess buggered’ is closed to new replies.
Skip to toolbar