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 happen. Lately, many parts of has been a target of DDOS attacks and it always seems to start in Canada.

Also, I got an 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 trying to get me to refund it as well “outside of PayPal”) and the details that were 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 countries (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 work 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 IPs 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) 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 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 browser.

My advice, use more than 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 at some point in this blog life called – Robin Williams – Blame Canada (South Park).

Enjoy πŸ˜‰

Need to reference?

Ellis, M. (2008). All the time I wished I could blame Canada. [online] Snat's Narratives & Tales. Available at: [Accessed 07 Dec 2023].

Steam Key Giveaway!

Every month on the final Sabbath, I take a random comment that has been posted that month and for that lucky winner they will win a random key from G2A! Join Discord for any questions or leave a comment!

Thanks for reading! You may be interested in this …

Notify of

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

Inline Feedbacks
View all comments