Skip to main content

htaccess blocking IP's

Comments

7 comments

  • Infopro
    Sure, find the icon in your cPanel called "IP Blocker".
    0
  • keat63
    Doesn't IP blocker require me to insert these IP's manually, which is what I'm trying to avoid. Also, this affects every subdomain on the Cpanel, which appears to have a detrimental affect with some of the -Ecommerce sites. I did find this which I'm just toying with. order allow,deny deny from all
    0
  • keat63
    And that didn't work, I still see them in the visitors log.
    0
  • Infopro
    I'm a bit confused I guess. There is no automated way that I know of to block IP addresses you don't want visiting your site. When you add an IP there as mentioned, its added to the htaccess that you asked about. Yes, if you block an IP using the "IP Blocker" it should block all access to the account. Blocking an IP on one part of your site, but not another to avoid any detrimental affects makes no sense to me.
    0
  • keat63
    The cpanel account is split in to subdomains. A few of the sites on these subdomains have cubecart which uses some sort of htaccess rewrite rule for SEO purposes. The moment you start messing with IP Blocker, it does something to the htaccess file across all subdomains, which breaks the cubecart sites. I want to just modify the htaccess file on one particular subdomain, without affecting any of the others.
    0
  • deadlock
    order allow,deny deny from all

    This does what you want it to do. The visits will still show in the access-logs (if that's what you mean) but if you take a closer look you will see they are "404" entries. The page will show as "Forbidden" (you can see that for yourself). The botter will eventually notice this and stop the requests.
    0
  • keat63
    Its Apache 2.4 and seems needs a little different approach. I added: Require all granted Require not ip xxx.xx.xx (a short list of class c's) order allow,deny deny from all hopefully, they will go away.
    0

Please sign in to leave a comment.