Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2017-04-19 15:38:51

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,054
Website GitHub Mastodon Twitter

How do I block referrers from domain extensions?

I am getting a lot of spam referrers from .porn and .taxi domain extensions. As both of those handles are irrelevant to our sites, I’m trying to figure out how to block all referrers from them.

Can anyone give me some pointers?


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#2 2017-04-19 15:44:48

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

Re: How do I block referrers from domain extensions?

You can do that in the .htaccess file, see here

Offline

#3 2017-04-19 16:23:15

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,054
Website GitHub Mastodon Twitter

Re: How do I block referrers from domain extensions?

Hi Phil… Thanks for the link. I am currently using another method which does not need all the backslashes but the list is getting very big. As such I am trying to find a way to block all referrers who use .porn and .taxi extensions. Although I am all too aware that this is a losing battle I am not giving up just yet:)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#4 2017-04-19 16:28:32

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,473

Re: How do I block referrers from domain extensions?

On this website perishablepress.com you can also find many tips.

Offline

#5 2017-04-19 17:02:25

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,054
Website GitHub Mastodon Twitter

Re: How do I block referrers from domain extensions?

GugUser wrote #305397:

On this website perishablepress.com you can also find many tips.

That’s for query strings :(


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#6 2017-04-19 17:45:13

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,473

Re: How do I block referrers from domain extensions?

I know, but on the same site you can find many other tips.

Offline

#7 2017-04-20 05:57:57

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,054
Website GitHub Mastodon Twitter

Re: How do I block referrers from domain extensions?

GugUser wrote #305401:

I know, but on the same site you can find many other tips.

Thanks… I looked through it and did not find anything. I guess with the proliferation of new domain extensions, it will be just a matter of time before a blocking solution will turn up.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#8 2017-04-20 11:17:04

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,202
GitHub

Re: How do I block referrers from domain extensions?

Yiannis, are you using purely Textpattern access/referrer stats, or another product/service?

Offline

#9 2017-04-20 11:55:33

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,054
Website GitHub Mastodon Twitter

Re: How do I block referrers from domain extensions?

Hi Pete,

I’m using slimstat & google analytics. The issue though is not only the stats but also the bandwidth. 3 days ago I got about 1600 ‘page views’ (within 20 minutes) from various .porn and .taxi spam referrers. This is basically the reason I want to block both extensions in the htaccess file.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#10 2017-04-21 08:41:06

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,202
GitHub

Re: How do I block referrers from domain extensions?

colak wrote #305408:

This is basically the reason I want to block both extensions in the htaccess file.

Forgive me if I’m covering well-trodden ground: have you thought about Cloudflare? Cuts back on the bots significantly and has other benefits, too. The $20/month plan may well save you some hours and pay for itself.

Offline

#11 2017-04-21 09:35:25

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,054
Website GitHub Mastodon Twitter

Re: How do I block referrers from domain extensions?

gaekwad wrote #305422:

Forgive me if I’m covering well-trodden ground: have you thought about Cloudflare? Cuts back on the bots significantly and has other benefits, too. The $20/month plan may well save you some hours and pay for itself.

It’s a personal dislike


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#12 2017-05-15 16:54:52

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,054
Website GitHub Mastodon Twitter

Re: How do I block referrers from domain extensions?

Got it! Here is the directives should anybody need it but do use with care. The site I am implementing this on, has low traffic and no known links from these domains.

RewriteEngine on
RewriteCond %{HTTP_REFERER} ^http(s)?://[^/]+\.adult/? [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://[^/]+\.kz/? [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://[^/]+\.porn/? [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://[^/]+\.pro/? [NC,OR]
# RewriteCond %{HTTP_REFERER} ^http(s)?://[^/]+\.ru/? [NC,OR]
# How can I exclude yandex.ru from here?
RewriteCond %{HTTP_REFERER} ^http(s)?://[^/]+\.taxi/? [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://[^/]+\.top/? [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://[^/]+\.ua/? [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://[^/]+\.xyz/? [NC]
RewriteRule .* http://127.0.0.1/ [R,L]

Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

Board footer

Powered by FluxBB