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,, and, enter the following code into your .htaccess file.

#block referrers
RewriteCond %{HTTP_REFERER} [NC,OR]
RewriteCond %{HTTP_REFERER} [NC,OR]
RewriteCond %{HTTP_REFERER} [NC,OR]
RewriteCond %{HTTP_REFERER}[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 *

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