Home arrow Forum arrow The Internet arrow Programming arrow Blocking users by IP Spacer
Spacer

Main Menu

Home
Shop
News
Domains
Forum
Web Hosting

Login Form

Welcome, Guest. Please login or register.
January 09, 2009, 01:26:49 AM
Username: Password:
Login with username, password and session length

Forgot your password?

Links

Blocking users by IP
My Community
January 09, 2009, 01:26:49 AM *
Top 10 Web HostingWelcome, Guest. Please login or register.

Login with username, password and session length
News: SMF - Just Installed!
 
   Home   Help Search Shop Login Register  
Pages: [1]
  Print  
Author Topic: Blocking users by IP  (Read 735 times)
moinuddin102
Jr. Member
**
Posts: 65
4.00 credits

View Inventory
Send Money to moinuddin102

View Profile
« on: September 06, 2006, 03:56:12 PM »

Is there a pesky person perpetrating pain upon you? Stalking your site from the vastness of the electron void? Blockem! In your htaccess file, add the following code--changing the IPs to suit your needs--each command on one line each:

Quote
    order allow,deny
    deny from 123.45.6.7
    deny from 012.34.5.
    allow from all

You can deny access based upon IP address or an IP block. The above blocks access to the site from 123.45.6.7, and from any sub domain under the IP block 012.34.5. (012.34.5.1, 012.34.5.2, 012.34.5.3, etc.) I have yet to find a useful application of this, maybe if there is a site scraping your content you can block them, who knows.

You can also set an option for deny from all, which would of course deny everyone. You can also allow or deny by domain name rather than IP address (allow from .webb360.com works for www.webb360.com or forum.webb360.com, etc.)
Logged
SEO Articles

My Community
« on: September 06, 2006, 03:56:12 PM »

 Logged
Cincian
Full Member
***
Posts: 196
6.00 credits

View Inventory
Send Money to Cincian

View Profile
« Reply #1 on: September 09, 2006, 06:53:10 AM »

be careful when blocking a subnet (deny from 012.34.5. - it should actually be deny from 012.34.5), anyone accessing from that range is blocked. So innocent users and new visitors will be blocked and this is especially bad if your site is for a certain geographical area and you end up blocking off several users that have no relation to the user that your banning. I suggest you block individual ips rather then subnets.
Logged
SEO Articles
My Community
« Reply #1 on: September 09, 2006, 06:53:10 AM »

 Logged
krystalc7
Jr. Member
**
Posts: 65
107.00 credits

View Inventory
Send Money to krystalc7

View Profile
« Reply #2 on: June 08, 2007, 08:47:53 AM »

i usually ban people via cpanel but this is good, also htaccess if you don't have cpanel
Logged
SEO Articles
Shadow1243
Sr. Member
****
Posts: 439
479.00 credits

View Inventory
Send Money to Shadow1243

ForeverShadowww@live.com
View Profile Email
« Reply #3 on: July 09, 2007, 11:14:20 PM »

i usually ban people via cpanel but this is good, also htaccess if you don't have cpanel

yes,right
Logged
SEO Articles
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1 RC3 | SMF © 2001-2006, Lewis Media Valid XHTML 1.0! Valid CSS!
Spacer