WordPress.org

Ready to get started?Download WordPress

Forums

.htaccess CRASHING server - intensive CPU usage (3 posts)

  1. tedwinters
    Member
    Posted 8 years ago #

    Hi guys,
    I have mod-rewrite on, and my wordpress .htaccess is crashing the server..
    CPU loads of 12-14 when permalinks are on..
    as soon as I nuke the .htaccess, it all goes down..

    Now, my blog isn't a heavy traffic site, but, it's in the root directory, and some of the non-blog pages off of root receive pretty heavy traffic...
    because the .htaccess is in the root, all the pages read it, and it generates enormous server load...

    How can this be fixed, short of moving my blog into a subdirectory?

  2. jaseone
    Member
    Posted 8 years ago #

    Are the non blog pages in sub directories? If so place a .htaccess within each of the directories with:

    RewriteEngine Off

  3. tedwinters
    Member
    Posted 8 years ago #

    Humm, unfortunately, I have to use rewrite conditions to block referrers :(
    this what I already have in the .htaccess in sub directories:

    RewriteEngine On
    Options -Indexes

    RewriteCond %{HTTP_REFERER} .*fusker*.*$ [NC]
    RewriteCond %{HTTP_REFERER} .*usefulidiot*.*$ [NC]
    RewriteRule .*\.(gif|jpg|jpeg|bmp|png)$ - [F,NC]

    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?google.com/.*$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?yahoo.com/.*$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?msn.com/.*$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?altavista.com/.*$ [NC]
    RewriteRule \.(gif|jpg|jpeg|bmp|avi|wmv)$ http://www.mydomain.com/ [R,L]

    order allow,deny
    deny from fusker.com
    allow from all

    order allow,deny
    deny from lewww.com
    allow from all

    I'm mainly interested in blocking everything from *fusker* and everything from *lewww*
    all else is allowable..

Topic Closed

This topic has been closed to new replies.

About this Topic