View Single Post
Old 06-11-2002, 09:28 AM  
salsbury
Confirmed User
 
Join Date: Feb 2002
Location: Seattle
Posts: 1,070
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.
__________________
salsbury is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote