Full On Design

Berkshire Based Web Development

 

Blocking users via .htaccess

Rogem

About the Author

Mike Rogers is a Web Developer who is currently at University studying Web Technologies. He also is the founder of Full On Design. He has several years experience freelancing and you can follow him on Twitter (Rogem002).

Every website has problems with users . Here is a cool way to ban users who prove to be annoying.

Open your .htaccess file (should be above your public_html folder and you may need to show hidden files), then add the following:

order allow,deny
deny from [IP here]
allow from all

If you want to add more than one IP, just add an extra “deny from [ip here]” line. On the other hand, if you want to just let one person onto a website just use the following:

order allow,deny
allow from [IP here]
deny from all

Allowing just a few IP’s to certain areas is useful when protecting administrator sections or user areas.

  • Delicious
  • Facebook
  • Digg
  • Reddit
  • StumbleUpon
  • Twitter

Leave a Reply