Featured Posts

A Chain Mail Victim’s Hilarious MailA Chain Mail Victim’s Hilarious Mail Hi Pals, I am writing this post after a very long time because I was suffering from my health problems and was not able to sit in front of my computer. But I am sure that this post will give you...

Readmore

Indian Rupee Got its Own SymbolIndian Rupee Got its Own Symbol This post is not related to seo or Blogging, but I thought I shall share it with you all, as I am feeling very proud that Indian Currency has got its own symbol. The symbol combines the Devnagri “Ra”...

Readmore

How to Block an IP from Accessing Your WebsiteHow to Block an IP from Accessing Your Website Some days before i was checking logs of one of my website related to travel and i found that an IP was sucking a lot of bandwidth from my hosting account. But the website (the IP) was not sending any visitor...

Readmore

Namecheap Coupon Code for July 2010Namecheap Coupon Code for July 2010 The NameCheap.Com (aff link) is my favorite domain reseller registrar and I book all my domains from them, Infact I have registered over 70 domains with them, because in my opinion they have the cheapest...

Readmore

Adsense Revenue Share Secret is Finally OutAdsense Revenue Share Secret is Finally Out The great secret of Adsense revenue share with Google and publishers is finally out and the company took this step for greater transparency in their operations. The percentage of revenue which Google...

Readmore

  • Prev
  • Next

How to Block an IP from Accessing Your Website

Posted on : 12-07-2010 | By : rituraj | In : Domains, General, security

0

Some days before i was checking logs of one of my website related to travel and i found that an IP was sucking a lot of bandwidth from my hosting account. But the website (the IP) was not sending any visitor to my website. I got confused as what was happening, so i checked the website and found that they were leeching one of my video, using an iframe.

Means they were presenting my video to their visitors, opening directly from my website using an iframe.

In one way it was good for me because the video was watermarked with my website name, so my website was getting extra exposure. But my main concern was the amount of bandwidth they were leeching.

So i emailed them to either remove my video from their website or host it on their own server, but i haven’t got any reply from them…

So i have banned their IP from accessing my website.

I wrote this post because i though many of you would have faced this problem, or may face in future. So what to do in such a situation?

There are probably two easy solutions for this, which are as follows:

1. Use free video hosting websites: You can use free video hosting websites like youtube.com for hosting your video. Once you have uploaded your video on youtube.com, you can embed them anywhere on your website, without worrying about bandwidth consumption.

2. Permanently Ban the IP or Website from Accessing your website: You can permanently ban any IP or website from accessing your website with the help of HTACCESS file.

Example: If you know the IP address (For an example we take this case, suppose  it is 192.129.0.1) write

order allow, deny
deny from 192.129.0.1
allow from all

If you want to block multiple IP address using .htaccess simply add one IP address per line as below:-

order allow, deny
deny from 192.129.0.1
deny from 192.129.0.2
deny from 192.129.0.3
allow from all

You can even block a network range IPs using .htaccess:-

order allow, deny
deny from 192.0.0
allow from all

You can also use the name of the website like:

order allow, deny
deny from website URL(”website.com”)
allow from all

If you are using wordpress blogs there is a good plug-in available for blocking IP Addresses

Like: WP-Ban

If you are not familiar with HTACCESS File, let me show you how to make one

1. Open notepad
2. Write the code which you want to write in the HTACCESS (As shown in examples above)


3. Click Save As and type .htaccess in file name and choose Save As Type as All Files.

Next upload the file to the root folder of your website and you are done.

If you are getting any problem and need any help, please post in comments and i will try to help you out. Your suggestions are also welcome

Bookmark & Share!!!
[Connotea] [del.icio.us] [Digg] [diigo] [Facebook] [Fark] [Faves] [LinkedIn] [Netvouz] [Reddit] [Squidoo] [StumbleUpon] [Technorati] [Twitter] [Yahoo!]

Popularity: 13% [?]

Write a comment