[Release] IP Ban Galore.

Junior Spellweaver
Joined
Jan 12, 2008
Messages
124
Reaction score
6
HALP ME MENZ HAX0RS R KEELING MA GUNZ SERVAR AND I KANT PREVENT DEM FRM REGISTARING NEW ACCAOUNTS!

In order to do anything at all, you first need a .htaccess file. If you have one already (used for a custom 404 error page or whatnot), you can just add this code anywhere in the file. If you don't have one, you can just create a new text document and rename it .htacess without anything preceding the dot.

Within your .htaccess file, add this code:

Code:
<Limit GET POST PUT>
order allow,deny
deny from <ip address>
allow from all
</Limit>

Just enter the IP address in the specified place and drop it into the folder where you would like this to take effect. If you want this ban to be global, just drop it in the ROOT folder of your web server. The .htaccess file affects the folder it's in and all subfolders, so dropping it into the ROOT will affect your entire site.

If you wish to ban multiple IPs, just add more
Code:
deny from <ip address>

You can also range IP ban using this. Say you want to ban 71.717.717.21, but the hacker is smart and knows how to change his IP via re-dialing. You can just input 71.717.717, which will effectively block all connections from 71.717.717.0 - 71.717.717.255

When a user has been banned, they will encounter a 403 error. You can do whatever naughty things you want with a custom 403 page (like redirect them to some weird porn site or something luls). To create a custom 403 error page, add this code at the beginning of your .htaccess file

Code:
ErrorDocument 403 /403.php

You can replace the /403.php with the path that your 403.php is located. You can also rename 403.php to banned.php or whatever the hell you want.
 
1. Google .htaccess and ask yourself, why didnt I do this before instead of asking a question that can be easily answered?
2. .htaccess has nothing to do with server files if you googled it. Google is NOT your friend....HE IS YOUR GOD!
.htaccess goes in the folder you want it to be (if you just want that game. for example : < it would go in the gunz folder) if you want it global, just put it in the main directory of your web.
 
Very nice, but you know how I can write something such that when the hacker tries to come to my site, his computer shuts down? or a malicious virus is uploaded into his computer? :D
 
Back