How To Restrict A Series Of IP Address Using .htaccess

MaxCDN Content Delivery Network

Htaccess is the default configuration file that manages your web server and its quite a very important file to be kept safer. I am not gonna teach you how to protect, rather a little information on how to restrict a set of IP (Internet Protocol) from accessing your blog. There are two important things that comes in my mind to restrict IP’s. At first to prevent someone’s IP whom you find suspicious and then to prevent spam comments that comes from a series of IP. Since I found these two points pretty important, I though its better to write about it.

Before getting into the tutorial take a backup of your .htaccess file. You can find the file placed in the file manager of your domain.

Restrict Multiple IP Address
order deny,allow
deny from 12.23.34.56
deny from 45.67.78.90
allow from all

Follow the same process if you want to deny single IP address.

Since most of us are not using static IP’s and hence its better to deny a series of IP. So follow the step below to prevent a series of IP’s accessing our blog or website.

Restrict a series of IP address
order deny,allow
deny from 23.45.56
allow from all

Note : While using the above code DON’T leave white space after comma.

July 15, 2010. This entry was posted in Tutorials, WordPress and tagged . Bookmark the permalink.

We Recommend HostGator Hosting

Bloggermint strongly recommends Hostgator Hosting for all of your web hosting needs. Sign up today for WordPress Hosting at just $4.95/month.

Use coupon code "bloggermint" to get 25% discount on any hosting packages. Get an account with Hostgator now!

No related posts.

8 Responses so far!

  1. Great post Franklin. I have not practice with IP address, but this post has taught me a lot. Thanks for sharing it.

  2. This is Really Good Franks! Since i Made my Blog Do-Follow, i Get Lost of Spam Comments, By this method i can Reduce the the SPAM Comments! Thanks For Sharing this!
    .-= Karthikeyan´s last blog ..Google BUZZ – New Comment and Like Tabs Feature =-.

  3. @Nicola – You can try its very easy to implement.

  4. @Karthi – Yes you can reduce spam comments to some extent.

  5. Pingback: Tweets that mention How To Restrict A Series Of IP Address Using .htaccess | Bloggermint -- Topsy.com

  6. Pingback: How To Restrict A Series Of IP Address Using .htaccess | Bloggermint | IP address.co.uk

  7. Pingback: SEO IP Class | SEO Services | SEO Traffic Spider | SEM

  8. Nice work Franklin…..thanks for sharing.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>