Forum Moderators: phranque

Message Too Old, No Replies

Any htaccess IP blocking script?

Something like cPanel DenyIP but without cPanel

         

Hobbs

4:42 pm on Mar 23, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Anyone heard of an 'off the shelf' htaccess manual IP blocking/unblocking script/interface?

I would like to assign the job of blocking IPs so someone else, but do not want to give them access to the DenyIP script that comes with cPanel as that would give them full access to everything else on the server.

I know some degree of trust would be needed, I'm also trying not to tempt fate. I've looked everywhere but either there is none or I can't use Google to find things anymore.

jdMorgan

5:44 pm on Mar 23, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You could do this with a password-protected "page" that POSTs to a cgi-script to add a line such as

SetEnvIf Remote_Addr ^<user-input-IP-address>$ getout

to the beginning of your .htaccess file.
Then, within .htaccess,

SetEnvIf Request_URI ^(robots\.txtĤpath-to-custom-403-error-page\.html)$ special
Order Deny,Allow
Deny from env=getout
Allow from env=special

The idea being that you never want to block access to robots.txt or to your custom 403 error page, as doing either will lead to major problems.

Jim

Hobbs

6:21 pm on Mar 23, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Thanks Jim,

that POSTs to a cgi-script

Yep, I'm looking for that script, also DenyIP lists currently blocked IPs and allows both unblocking and blocking, which is exactly what the IP blocking person would need.. I'm guessing then that there is no such animal off the shelf that I can just upload and run.