How To Block Referrals to My Website Through .htaccess?

Started by newnerd, 10-31-2018, 10:43:37

Previous topic - Next topic

newnerdTopic starter

I want to block referrals from a website and it's country level domains from visiting my website. - How can I do that from .htaccess?

for e.g: I wanna stop example.ru , example.dk, example.bd, example.in, example.nu and all example.** ...... to stop sending referrers to my website.
  •  


susanburling

You can block Visitors to your website by Country Using Firewall
This link might be helpful https://www.ip2location.com/blockvisitorsbycountry.aspx


John - Smith

hey op

country firewall[link shared by susanburling] works for you? let us know  :)

billyjhon

Be exceptionally cautious contributing directions in the .htaccess record. ...

Login to your Google Analytics account.

Snap Admin.

Snap All Filters.

Give the channel a name.

Select Predefined.

Select 'Bar', 'traffic from IP locations' and 'that are equivalent to' in the cases underneath.

Neel Patel

Instead of asking an SEO person, ask this to a developer!
they can help you as they are good at reg exp. and these htacess files and all!


Lishmalinyjames

The most effective way to block your spam referral traffic is through a . htaccess (hypertext access) file. This configuration file is used to control your server. It can be instructed to block spammy visits by domain or IP address.

makoo

There are many referrer spam websites that will send you a fake hit to your website. You may not be able to control or stop these hits. However, there is a way to filter these web referrals by creating RewriteRules for each one of them in your .htaccess file.
The .htaccess file is a configuration file for Apache web servers that works on a directory basis. When you grant permission for another website to access your files, you may sometimes get more than you bargained for. hаckers can exploit vulnerabilities in the server and the application software running on it. And even if hаckers don't find a way in, another website may share your bandwidth or send spam to your users on your behalf. Here are some ways to use .htaccess to block referrals from other websites.
  •  

f1dark

Instead of asking an SEO person, ask this to a developer!
they can help you as they are good at reg exp. and these access files and all!


MOHAN


You can also block spam referral sites through cPanel.

1. Login into your hosting cPanel.
2. Go to Security section and click on IP Deny Manager.
3. Enter the IP address or domain name, which you want, to block.
4. Click on Add.
  •  


OwnWebServers

To block referrals to your website through .htaccess, add the following code:

RewriteEngine on
RewriteCond %{HTTP_REFERER} spam-domain\.com [NC,OR]
RewriteCond %{HTTP_REFERER} another-spam-domain\.com
RewriteRule .* - [F]

Replace "spam-domain.com" and "another-spam-domain.com" with the actual spam referral domains you want to block. This code prevents access from those domains to your site.
  •