Post by OpenCode » Sun Oct 21, 2018 12:49 am

blocking spam referrer websites - the right way via htaccess how?

I like to block spam referrer site via .htaccess which one is the right way to do so.
a sample one

Code: Select all

RewriteCond %{HTTP_REFERER} ^http://.sample.one\.com/ [NC]
RewriteRule ^(.*)$ – [F,L]
sample two

Code: Select all

RewriteCond %{HTTP_REFERER} ^https?:\/\/([^.]+\.)*sample.two\.com [NC]
RewriteRule .* - [F]
and blocking full countries (why? because we don't serve these countries) and always contact us asking if we ship to their countries

Code: Select all

RewriteCond %{HTTP_REFERER} \.(ru|kz|in|ua)(/|$) [NC] 
RewriteRule .* - [F]
or this way

Code: Select all

Order allow,deny
deny from .ru
deny from .kz
deny from .in
deny from .ua
which one is the right way to do so.

any help

Opencart 3.0.2.0
Thank you
to all geeks.

New member

Posts

Joined
Fri Jun 07, 2013 9:31 am

Post by straightlight » Sun Oct 21, 2018 1:25 am

I would not advise on using strict rules to prevent SPAMs as the false-positive engines could also be blocked. I would suggest using a re-captcha extension with the CSRF Protection extension from the Marketplace.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by OpenCode » Fri Nov 02, 2018 2:55 am

Thank you for your answer straight light,
but what good juice (false-positive engines) can come from SPAM REFERRER, for small business can be hurt from these spam I think you know better.

using re-captcha and CSRF Protection only help to prevent boots to create an account on your site but these are not respected by the spammers,
blocking them via HTACCESS is a much better solution since the major search engines don't rank your site by spam referrer, by they can definitely hurt small business.

is like having externals backlinks from XXX to your site when you sell other products not related to the porn industry.

New member

Posts

Joined
Fri Jun 07, 2013 9:31 am

Post by ADD Creative » Fri Nov 02, 2018 7:27 am

Sample one will only match that exact domain. Sample two will also match the https version and any sub domains such as www. (although it should have a \ in from of the . before two.

Doing this may stop spam, but would it stop the effect of the backlink on SEO? The only way may be to get the backlinks removed or disavow them. https://support.google.com/webmasters/a ... 8487?hl=en

Sample three will block users if they have been referred from a site with one of those TLDs. You may need a \ before the /.

Sample four will block if the reverse DNS of the user's IP address ends with one of the TLDs. Reverse DNS may not be at reliable for detecting a user's country. https://httpd.apache.org/docs/2.2/en/mo ... _host.html

The best way to block by countries would probably be by an IP address list.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by IP_CAM » Fri Nov 02, 2018 10:04 am

I don't block specific IP Numbers, but whole subsections, and depending on how many
access-attemps I get from a Main IP Number, I eventually block the entire range. And this
so far kept me from bothering any longer about those, trying to 'find out'. In addition,
I redirect calls, using the same code, as has been used before, automatically to LasVegas.
And if someone get's temporarely blocked, due to repeated attempts, I receive an email:

Code: Select all

A host 200.72.159.2 has been locked out of the site until 2018-10-31 17:55:15 
(server time) due to too many attempts to open a page or file that does not exist.
Ernie
---
my latest bad-guy .htaccess Blocker, placed it the Site ROOT .htaccess file:

Code: Select all

<Files *>
order allow,deny
allow from all
deny from 2.228.
deny from 5.101.
deny from 5.133.
deny from 5.188.
deny from 5.189.
deny from 5.9.167.
deny from 5.39.93.
deny from 5.62.
deny from 5.77.34.
deny from 14.
deny from 17.40.
deny from 23.91.71.
deny from 27.254.57.
deny from 31.
deny from 31.131.22.
deny from 35.154.
deny from 35.184.
deny from 35.189.
deny from 35.194.100.
deny from 36.68.
deny from 36.73.
deny from 36.74.190.
deny from 36.78.120.
deny from 36.80.74.
deny from 36.82.103.
deny from 37.9.169.
deny from 41.140.
deny from 43.225.
deny from 45.40.
deny from 45.77.
deny from 45.122.
deny from 45.252.248.
deny from 46.
deny from 46.105.116.
deny from 46.229.168.
deny from 47.52.
deny from 47.90.
deny from 47.91.
deny from 50.62.160.
deny from 52.36.
deny from 52.39.
deny from 52.67.91.
deny from 54.36.148.
deny from 54.36.149.
deny from 61.139.126.
deny from 61.219.126.
deny from 64.34.120.
deny from 64.111.117.
deny from 65.99.237.
deny from 69.195.124.
deny from 72.167.190.
deny from 77.66.6.
deny from 77.243.191.
deny from 80.211.145.
deny from 85.94.197.
deny from 85.140.1.
deny from 85.217.171.
deny from 91.134.248.
deny from 91.214.130.
deny from 91.227.138.
deny from 91.237.88.
deny from 92.105.112.
deny from 93.185.104.
deny from 94.23.208.
deny from 94.73.151.
deny from 94.240.32.
deny from 95.110.235.
deny from 95.170.83.
deny from 101.53.136.
deny from 103.27.236.
deny from 104.211.215.
deny from 106.187.44.
deny from 107.152.104.
deny from 107.180.77.
deny from 107.180.120.
deny from 107.181.176.
deny from 108.170.20.
deny from 108.179.199.
deny from 112.78.5.
deny from 112.213.89.
deny from 119.28.212.
deny from 119.28.228.
deny from 119.81.52.
deny from 149.154.153.
deny from 149.202.107.
deny from 152.167.25.
deny from 152.231.79.
deny from 155.133.132.
deny from 155.133.142.
deny from 166.70.132.
deny from 173.254.28.
deny from 174.136.12.
deny from 176.9.57.
deny from 185.22.173.
deny from 185.36.81.
deny from 185.86.79.
deny from 185.156.175.
deny from 185.234.218.
deny from 188.186.16.
deny from 191.92.100.
deny from 192.252.214.
deny from 193.202.110.
deny from 197.211.212.
deny from 200.72.159.
deny from 202.65.196.
deny from 203.189.120.
deny from 204.197.220.
deny from 209.140.27.
deny from 209.160.24.
deny from 210.122.38.
deny from 210.127.
deny from 211.202.
deny from 212.
deny from 213.32.
deny from 213.136.88.
deny from 213.145.
deny from 213.163.93.
deny from 213.251.
deny from 216.
deny from 217.
deny from 222.122.56.
deny from 223.73.2.
</Files>
Redirect image Link:
download/file.php?mode=view&id=35899

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by OpenCode » Thu Nov 22, 2018 2:09 pm

@ IP_CAM.

Thank you for providing yo "bad guy file" blocker - can you enlighten me what exactly your bad guy do...

and how do I send the bad guys to Vegas...

Thank you

New member

Posts

Joined
Fri Jun 07, 2013 9:31 am

Post by IP_CAM » Thu Nov 22, 2018 2:59 pm

Well, it highly depends on my emotional feelings :laugh: , but generally,
whoever calls one of my Sites by use of a fishy link, will be checked
by it's IP-Number, and if it does NOT belong to a 'friendly' Country, I re-send
'em to Vegas for good. And this, by 'globally' reroute all 'identical' linkings
used, in case, that someone else will try to get in the same way, and in the
.htaccess File, by adding, by example: 123.456.789. , if an IP-
Numer uses 123.456.789.xxx , to block everything, whatever looks like:
123.456.789.001 - 255, to make sure, that, whoever comes trough that
123.456.789.Whatever range, will no longer be able to access my Sites.
It's a daily Job to check and make sure, but it will pay out in the longer terms ... ;)
But I am not sure, if the two extensions I use also exist for later OC-Versions.
Ernie
PS. I even found some of those re-linkings on Google ! :laugh:
---
Image

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by phpinterview1991 » Thu Nov 22, 2018 3:48 pm

You’ll have to edit your .htaccess file with the following code:

## STOP REFERRER SPAM
RewriteCond %{HTTP_REFERER} example\.com [NC,OR]
RewriteCond %{HTTP_REFERER} example2\.com [NC,OR]
RewriteCond %{HTTP_REFERER} semalt\.com [NC,OR]
RewriteRule .* – [F]

Copy that code above, replace ‘example\.com’ with the URL you want to block and add that to your .htaccess file. You can copy and add a “RewriteCond” line for every URL you want to block (make sure to include the “\” before the dot).

------------------------------------------------------------
php interview questions, php interview questions and answers, php interview questions for frehers


Posts

Joined
Thu Nov 22, 2018 3:41 pm
Who is online

Users browsing this forum: JessiesBoutique, SelfSus, tilly and 521 guests