How to Block an IP Address on Your Joomla Website?

Sometimes, you feel that you are obliged to block a certain IP from accessing your Joomla website. Reasons may include:

  • The IP is hacking your website.
  • The IP is scraping content from your website.
  • The IP is attacking your website with a lot of requests.
  • The IP is continuously spamming your website.
  • The IP is hotlinking to your website.

This is not complicated at all, all you need to do the following:

– Connect through FTP to your website
– Download the file called .htaccess
– Add the following lines to the .htaccess file:


order allow,deny
deny from 70.80.121.123
allow from all

Now let’s assume that you are being attacked by more than one IP, here’s what you should do


order allow,deny
deny from 70.80.121.123
deny from 60.80.23.44
allow from all

Now let’s assume that you are being attacked by a range of IPs, for example, all the IPs that start with 70.80.121, here’s what you should do:


order allow,deny
deny from 70.80.121
allow from all

Now let’s assume that you are being spammed/hacked by a small sized ISP, and you decide that you don’t want any traffic coming from that particular ISP, here’s what you should do:


order allow,deny
deny from badisp.com
allow from all

Now, the question remains, how do you know what are the IPs that are spamming you? This is very easy, you check your log files, and see if there are repetitive requests from that same IP.

If you feel that you can’t do the above then feel free to contact us, we are always there to help!

2 Responses to “How to Block an IP Address on Your Joomla Website?”
  1. Pingback by How to Block a Whole Country on Your Joomla Website? | itoctopus — January 12, 2012 @ 12:42 pm

    […] have explained before on how to block a specific IP or range of IPs from accessing your Joomla website. Since we have published that article, we had many requests asking us on how to block a specific […]

  2. Pingback by How to Protect Your Content on Your Joomla Website | itoctopus — January 25, 2012 @ 4:35 pm

    […] of your weblogs, to know which IP is stealing content from your Joomla website. You can either block that IP or block the country that hosts this IP altogether. Again, if the person is persistent, then he […]

Leave a comment