The MU forums have moved to WordPress.org

Simple 'Deny From' Creates Error 500s (5 posts)

  1. jshare
    Member
    Posted 15 years ago #

    Trying to protect my install from site scrapers by blocking certain user-agents and IPs, I noticed that even a simple block of one IP will generate 'seemingly random' error 500s in my Apache PHP error_log.

    This is what I added to my root .htaccess file (which is where WPMU is installed):

    Order Allow,Deny
    Allow from all
    Deny from xx.xx.xx.xx (with the targeted IP)

    That's it. Perhaps - does it matter where I place this block in my .htaccess file?

  2. drmike
    Member
    Posted 15 years ago #

    Shouldn't matter. I've never seen it written that way although a quick search shows that it will work. I always do it like this:

    order allow,deny
    deny from 127.0.0.1
    deny from 127.0.0.2
    deny from 127.0.0.3
    allow from all

  3. jshare
    Member
    Posted 15 years ago #

    Thanks. I've found a solution that works without needing to go that route - the WP-Ban plugin.

  4. drmike
    Member
    Posted 15 years ago #

    *chuckle* That'll work.

    Still curious as to why the deny didn't work for you though. You are running Apache, right?

  5. jshare
    Member
    Posted 15 years ago #

    Yeah - 2.0.54. It is weird, and I usually try to go for the root cause but with MediaTemple I've gotten the habit of always looking over my shoulder

About this Topic