Block website traffic coming from certain websites

You can block traffic coming to your website from other websites using .htaccess.

Note: You will need an ftp account and an ftp program to access your website’s .htaccess file. You can edit your .htaccess file using a text editing program like Notepad. When you save the .htaccess file, make sure you save as file type ‘All Files’. To open a .htaccess file, first open your text editor program, select ‘File’ > ‘open’, navigate to your .htaccess file and make sure you have ‘All Files’ selected so you can view the .htaccess file.

For example, to block traffic coming to your website from spammy.info, morespam.com, gospam.net and 123.spamblast.org, enter the following code into your .htaccess file.

#block referrers
RewriteCond %{HTTP_REFERER} spammy.info [NC,OR] RewriteCond %{HTTP_REFERER} morespam.com [NC,OR] RewriteCond %{HTTP_REFERER} gospam.net [NC,OR] RewriteCond %{HTTP_REFERER} 123.spamblast.org[NC] RewriteRule (.*) – [F]

Save the file and upload it to your website’s root directory.

Leave a Comment

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