BBS.PROGENIC.COM
Home      Members   Calendar   Who's On   SOTM
Welcome Guest ( Login | Register )
      

Home » Chat » Coding » Code to bann from certain address


Code to bann from certain addressExpand / Collapse
Author
Message
Posted Friday, February 22, 2008 5:31 PM


Progenic Family

Progenic Family

Group: Forum Members
Last Login: 2 days ago @ 7:35 PM
Posts: 525, Visits: 1,361
Anyone know something like this ?
ban redirect give of a certain message ?
Post #13840
Posted Saturday, February 23, 2008 6:36 AM


Regular Member

Regular Member

Group: Forum Members
Last Login: Wednesday, September 03, 2008 5:34 AM
Posts: 59, Visits: 233
um, how do you want this to be done? via PHP or via Apache? just http ban or general server ban?
I usually ban IPs via iptables or hosts.deny, but of course this blocks any access and so there is just a "server not found" error for the "visitor". if you only want a http ban mod security is a good candidate...I don't know the exact filter rule at the moment, but should be no problem to find out by reading the docs or by sending a request to the mod security mailing list (which is a really good one).
but if you want to do it in PHP: sorry, I suck in PHP coding...^^
Post #13846
Posted Saturday, February 23, 2008 6:11 PM


Progenic Family

Progenic Family

Group: Forum Members
Last Login: 2 days ago @ 7:35 PM
Posts: 525, Visits: 1,361

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^/index.php/?(.*)$ [NC]RewriteCond %{HTTP_REFERER} !^http://www.allowedcom/(.*) [NC,OR]
RewriteCond %{HTTP_REFERER} !^https://www.allowed.com/(.*) [NC]RewriteRule ^.*$ http://www.sendyouthere.com/ [R=301,L]

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} http://www.mysite.net/ [NC]RewriteCond %{HTTP_REFERER} !^http://www.baned-site.com/ [NC]RewriteRule ^.*$ http://www.redirectsite.com/ [R=301,L]


I am trying something like this in .htaccess but seems not to work my goal is to redirect referrals from a certain website

The second one is what i want but it seems it just takes on the last command to rewrite and anywhere it comes from it redirects ...anyone know what's wrong with the syntax ?





FINALLY
was just complicated the shit out of myself

SetEnvIfNoCase Referer evil-bad-site.com anything-here=yes

Order allow,deny
allow from all
deny from env=anything-here



Post #13851
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 1 (1 guest, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: proge, wax

All times are GMT -6:00, Time now is 8:40pm

Progenic BBS 2008
Execution: 0.156. 10 queries. Compression Enabled.