All the time I wished I could blame Canada

There are many times I wish I could just blame Canada for many of the issues that happens. Lately many parts of has been a target of DDOS attacks and it always seems to start off at Canada.

Also, I got a order for a product that I was selling and someone brought it however the person ended up being a scammer (Asking PayPal to refund, then try to get me to refund it as well “outside of PayPal”) and the details that was recorded was that the person came from Canada.

Now, that aside and that Canada is a nice place (Or so I hear, still don’t wanna go there 😉 ) but after this, I decided that enough was enough so I decided to look into many ways to block different country (Not Canada) but other very high risk places like Iran so I decided to have a look into some solutions and I have found three ways that works the best.

The first way was blocking them via .htaccess and that is a failsafe method as it will just work (Apache is needed) however the list of IP can change and therefore you need to update it often (It is possible to do this automatically but that is a post for another day).

Once you have a list of all the IP addresses for the country you want to block (Have a look on Google) that you just put the following code into your .htaccess file ( is the part you want to change).

order allow,deny
deny from
allow from all

You also might want to put comments so you know which one is which (# is used for comments). The next method was using MaxFraud and PHP to block them. I won’t go into the PHP code that I used (A post for another day) but it worked just as well as .htaccess as I only needed to re-download the MaxFraud database when it was updated (Or use their API which I believe they have).

The final method was to use a web service that I found called Traffic Cleaner and it worked well as it updates by itself and that you can forward the banned users to any page that you wish ( just as long as you don’t have the same Javascript code is gives ya. The only problem that I saw is it used Javascript which sadly can be turned off via the user’s web broswer.

My advice, use more then one method to block any users you don’t want accessing your site.

Seeing the title topic says Blame Canada and I am a massive South Park fan (Just look at my name), here is a link to a post that I posted some point in this blog life called – Robin Williams – Blame Canada (South Park).

Enjoy 😉

Thanks for reading! You may be interested in this …

Join Honeygain - Start earning money by doing nothing.

Need to quote me?

Ellis, M (2008) All the time I wished I could blame Canada. [online] Tweaked for your Pleasure. Available at: [Accessed 17 May 2022]

Get more spam to your inbox!

Enter your email address to subscribe to Tweaked for your Pleasure and receive notifications of new posts by email.

Join 166 other subscribers.

0 0 votes
Article Rating
Notify of

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Inline Feedbacks
View all comments