htaccess Tutorials [IP Blocking]

Is someone getting gay on your site? Well you can just stop them from being able to come. This only works on people with DSL or Cable. Because a lot of people on 56k have dynamic IP's, which means they change every time they log on.

Well just paste the following code into notepad:
deny from 00.000.00.00
(Replace 00.000.00.00 with the IP you want to block).

Save it with file name as .htaccess, and the file type as All Files.

Now upload (in ASCII) that fucker into the directory you want to block the IP from. If you upload it into the root (main) directory (folder), they will be blocked from the entire site. If you have a custon 403 error page, it is a good idea to have it stored off your site. Because when the blcoked party tries to access your site, it will redirect him/her to the 403 error page. Now if that page is stored on the same server that the person is blocked there will be some confliction.

If it didn't work, then you saved the file as .htaccess.txt , didn't upload the file in ASCII, may need to CHMOD it to 644, or your host straight up doesn't support it.

UPDATE - 2/14/03

If you want to block all vistors for whatever reasons just add this to the root of your site or folder:

deny from all

If you want to deny all users and allow just certain ips do this:

deny from all
allow from 00.000.00.00

allow from 00.000.00.00

And so on..

If you find this information inaccurate or have questions post in the forums