Well, I don’t know if this is an easy thing to do, but I haven’t figured it out yet. Instead of continually updating my Htaccess file with newly updated country IP block lists (because my htaccess file is now as long as a trip to the moon), I’d like to include some bit of code in the main htaccess to “call” different IP lists, so I can easily re-upload a newly updated country ip block list to a folder of blocked countries (i use http://www.ipdeny.com/ipblocks/ for my lists)


random website folder
random website folder
random website folder
Countryblocklist folder ------inside this folder ,

Can anyone help me out with what code I could use inside the Htaccess to be able to call these foldered ipblock txt files???

(and please no jibes at me blocking countries lol, i really need to for my business, as hundreds from these countries have been playing havoc with my site for years now, also I cant use geo-ip thing, as i use bluehost for hosting)

Cheers guys.

1 Answer 1


There is no way to include external file for the block list. You can use include directive in httpd.conf only ,e.g.,

 Order Deny,Allow
 include conf/Countryblocklist/*
 Allow from all

with Deny in each IP. It requires server restart on each update, so you should consider blocking with script.

  • I dont understand what you mean.
    – Bob
    Commented Jan 18, 2013 at 15:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.