Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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)

FOR EXAMPLE:

random website folder
random website folder
random website folder
.HTACCESS
Countryblocklist folder ------inside this folder ,
                                      --->deny_nigeria.txt
                                      --->deny_china.txt
                                      --->deny_russia.txt
                                      ---->deny_any_other_country.txt

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.

share|improve this question
add comment

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.

share|improve this answer
    
I dont understand what you mean. –  Bob Jan 18 '13 at 15:44
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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