Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Announcement
#11 2017-04-21 09:35:25
- colak
- Admin
- From: Cyprus
- Registered: 2004-11-20
- Posts: 6,453
- Website
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.
Yiannis
——————————
neme.org | hblack.net | LABS | NeMe @ github
Offline
#12 2017-05-15 16:54:52
- colak
- Admin
- From: Cyprus
- Registered: 2004-11-20
- Posts: 6,453
- Website
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.org | hblack.net | LABS | NeMe @ github
Offline