Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 02-03-2010, 06:55 PM   #1
mkx
Confirmed User
 
Industry Role:
Join Date: Nov 2003
Location: Toronto
Posts: 4,001
.htaccess question, pulling up external list.txt

Need to use the same list of IP's to block on a few of my sites. Can I make it go to a list.txt file on the server somehow?

Current .htaccess:
##### start anti spy squirrel script
deny from XX.XX.XX.X
ErrorDocument 403 /error.html
##### end anti spy squirrel script

want to:

##### start anti spy squirrel script
deny from http://www.mysite.com/list.txt
ErrorDocument 403 /error.html
##### end anti spy squirrel script

and in list.txt i will list the ip's I want to block line by line.

How do I properly say this line?
deny from http://www.mysite.com/list.txt
mkx is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-03-2010, 07:18 PM   #2
anicetan
Registered User
 
anicetan's Avatar
 
Join Date: Mar 2003
Posts: 73
I think you can do it with mod rewrite
__________________

High Quality - Low Prices
anicetan is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-03-2010, 07:31 PM   #3
mkx
Confirmed User
 
Industry Role:
Join Date: Nov 2003
Location: Toronto
Posts: 4,001
code perhaps?
mkx is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-03-2010, 09:05 PM   #4
darksoul
Confirmed User
 
darksoul's Avatar
 
Join Date: Apr 2002
Location: /root/
Posts: 4,997
you can't do that with .htaccess alone.
__________________
1337 5y54|)m1n: 157717888
BM-2cUBw4B2fgiYAfjkE7JvWaJMiUXD96n9tN
Cambooth
darksoul is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-03-2010, 09:11 PM   #5
GrouchyAdmin
Now choke yourself!
 
GrouchyAdmin's Avatar
 
Industry Role:
Join Date: Apr 2006
Posts: 12,085
Quote:
Originally Posted by darksoul View Post
you can't do that with .htaccess alone.
Why did you base64 encode your ICQ?

Also, what's stated here.

It'd be easier for you just to make a script which reads the list.txt and prepends it to your .htaccess

This has no bounds checking and is dumb as hell, but will do what you want. Trivially wrapped as a CGI so you can activate via browser rather than shell. Again, it's stupid, but it's free.

addnewbans.cgi:
Code:
#/bin/sh
echo "Content-type: text/plain"
echo ""
echo "Parsing list.txt in current directory..."
for n in `cat list.txt`; do echo "deny from $n" >> newshit
cp .htacess .htaccess-last
mv newshit .htaccess
cat .htaccess-last >> .htaccess
echo "Done. .htaccess has new bans set; last copy is saved as .htaccess-last"
Edit: For denying a specific URL you'll want to use mod_rewrite.

Code:
RewriteCond %{HTTP_REFERER} ^http://clownpenis\.fart/booz.html [NC, OR]...
RewriteRule ^.*$ - [F]
__________________

Last edited by GrouchyAdmin; 02-03-2010 at 09:22 PM.. Reason: I only answered part of the question.
GrouchyAdmin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-03-2010, 09:32 PM   #6
mkx
Confirmed User
 
Industry Role:
Join Date: Nov 2003
Location: Toronto
Posts: 4,001
Thanks dude will try that out
mkx is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.