View Single Post
Old 06-11-2002, 09:34 AM  
BabeHunter
Webmaster
 
BabeHunter's Avatar
 
Industry Role:
Join Date: Oct 2001
Location: 2nd door on the left
Posts: 4,063
Quote:
Originally posted by salsbury
here's what i've got. it's a freebie, 'cause salsbury's a nice guy. (and 'cause i don't know if it'll work perfectly as-is. ;))

just a word of advice: using deny or allow with any type of hostname will force hostnamelookups on, which will slow down your surfer's experience. ie it's not so good.

create a file called "punklist.txt" in your site's root directory. add IP blocks and URLs to the file as so:

192.168.0 http://www.someblindlinksponsor.com/
127.0.0 http://www.whitehouse.gov/

etc. basically it expects to have the first 3 octets there. next, add the following to your httpd.conf file in your VirtualHost directive:

RewriteMap punk-o txt:/path/to/server/root/punklist.txt
RewriteCond %{REMOTE_ADDR} ^([0-9]*\.[0-9]*\.[0-9]*)\.[0-9]*
RewriteCond ${punk-o:%1|OK-TO-PASS} !=OK-TO-PASS
RewriteRule ^/.* ${punk-o:%1} [R,L]

unfortunately it won't work in the .htaccess file for whatever reason, silly apache.

if you'd like an explanation of all this, hit me for e-mail [email protected] . holy crap that took a lot longer to figure out than i expected. but it does indeed work.
Thanks man...but...the ip list that i have...is REALLY long...it will take days to write it...hehe
but thanks anyways
__________________
Yep
BabeHunter is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote