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.

Advertisements

Published by

angelo bonavera

Hi I'm a web developer and I run a web hosting company called 2slick.com.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s